Merge branch 'chore/login' into docs/swagger-autogen
This commit is contained in:
commit
bf36790b28
30 changed files with 5058 additions and 315 deletions
23
backend/src/routes/auth.ts
Normal file
23
backend/src/routes/auth.ts
Normal file
|
@ -0,0 +1,23 @@
|
|||
import express from 'express'
|
||||
import {getFrontendAuthConfig} from "../controllers/auth.js";
|
||||
import {authenticatedOnly, studentsOnly, teachersOnly} from "../middleware/auth/auth.js";
|
||||
const router = express.Router();
|
||||
|
||||
// returns auth configuration for frontend
|
||||
router.get('/config', (req, res) => {
|
||||
res.json(getFrontendAuthConfig());
|
||||
});
|
||||
|
||||
router.get('/testAuthenticatedOnly', authenticatedOnly, (req, res) => {
|
||||
res.json({message: "If you see this, you should be authenticated!"});
|
||||
});
|
||||
|
||||
router.get('/testStudentsOnly', studentsOnly, (req, res) => {
|
||||
res.json({message: "If you see this, you should be a student!"});
|
||||
});
|
||||
|
||||
router.get('/testTeachersOnly', teachersOnly, (req, res) => {
|
||||
res.json({message: "If you see this, you should be a teacher!"});
|
||||
});
|
||||
|
||||
export default router;
|
|
@ -1,14 +0,0 @@
|
|||
import express from 'express';
|
||||
const router = express.Router();
|
||||
|
||||
// Returns login paths for IDP
|
||||
router.get('/', (req, res) => {
|
||||
res.json({
|
||||
// Dummy variables, needs to be changed
|
||||
// With IDP endpoints
|
||||
leerkracht: '/login-leerkracht',
|
||||
leerling: '/login-leerling',
|
||||
});
|
||||
});
|
||||
|
||||
export default router;
|
Loading…
Add table
Add a link
Reference in a new issue