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;
|
||||
Reference in New Issue
Block a user