Files
yourpart3/backend/routers/authRouter.js
Torsten Schulz (local) 1ab9407e79
All checks were successful
Deploy to production / deploy (push) Successful in 2m56s
Refactor code structure for improved readability and maintainability; optimize performance across multiple modules.
2026-07-21 09:08:15 +02:00

24 lines
1.0 KiB
JavaScript
Executable File

import { Router } from 'express';
import AuthController from '../controllers/authController.js';
const router = Router();
const authController = new AuthController();
// Öffentliche Routen (keine Authentifizierung erforderlich)
router.post('/register', authController.register);
router.post('/login', authController.login);
router.post('/forgot-password', authController.forgotPassword);
router.post('/activate', authController.activateAccount);
router.get('/oauth/providers', authController.oauthProviders);
router.get('/oauth/:provider/start', authController.oauthStart);
router.post('/oauth/exchange', authController.oauthExchange);
// Geschützte Routen (Authentifizierung erforderlich)
router.get('/logout', authController.logout);
router.get('/oauth/user/identities', authController.oauthUserIdentities);
router.get('/oauth/user/:provider/start', authController.oauthUserStart);
router.post('/oauth/user/exchange', authController.oauthUserExchange);
router.delete('/oauth/user/:identityId', authController.oauthUserRemove);
export default router;