inital
This commit is contained in:
28
backend/src/routes/auth.routes.ts
Normal file
28
backend/src/routes/auth.routes.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { Router } from 'express';
|
||||
import authController from '../controllers/auth.controller';
|
||||
import { optionalAuth } from '../middleware/auth.middleware';
|
||||
|
||||
const router = Router();
|
||||
|
||||
/**
|
||||
* @route POST /api/auth/callback
|
||||
* @desc Handle OAuth callback from Authentik
|
||||
* @access Public
|
||||
*/
|
||||
router.post('/callback', authController.handleCallback);
|
||||
|
||||
/**
|
||||
* @route POST /api/auth/logout
|
||||
* @desc Logout user
|
||||
* @access Public (optional auth for logging purposes)
|
||||
*/
|
||||
router.post('/logout', optionalAuth, authController.handleLogout);
|
||||
|
||||
/**
|
||||
* @route POST /api/auth/refresh
|
||||
* @desc Refresh access token
|
||||
* @access Public
|
||||
*/
|
||||
router.post('/refresh', authController.handleRefresh);
|
||||
|
||||
export default router;
|
||||
14
backend/src/routes/user.routes.ts
Normal file
14
backend/src/routes/user.routes.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { Router } from 'express';
|
||||
import userController from '../controllers/user.controller';
|
||||
import { authenticate } from '../middleware/auth.middleware';
|
||||
|
||||
const router = Router();
|
||||
|
||||
/**
|
||||
* @route GET /api/user/me
|
||||
* @desc Get current authenticated user
|
||||
* @access Private
|
||||
*/
|
||||
router.get('/me', authenticate, userController.getCurrentUser);
|
||||
|
||||
export default router;
|
||||
Reference in New Issue
Block a user