WIP: admin auth

This commit is contained in:
Danny Avila 2025-08-30 04:41:51 -04:00
parent d04da60b3b
commit fbe0def2fa
No known key found for this signature in database
GPG key ID: BF31EEB2C5CA0956
8 changed files with 229 additions and 0 deletions

View file

@ -0,0 +1,29 @@
const express = require('express');
const { adminVerifyController } = require('~/server/controllers/auth/AdminVerifyController');
const { adminLoginController } = require('~/server/controllers/auth/AdminLoginController');
const middleware = require('~/server/middleware');
const router = express.Router();
// Admin local authentication route
router.post(
'/login/local',
middleware.logHeaders,
middleware.loginLimiter,
middleware.checkBan,
middleware.requireAdminAuth, // Uses local auth strategy + admin role validation
adminLoginController,
);
// Admin token verification endpoint
router.get(
'/verify',
middleware.requireAdminJwtAuth, // Validates JWT + admin role
adminVerifyController,
);
// TODO: Future OAuth/OpenID routes will be added here
// router.get('/auth/openid', ...);
// router.get('/auth/openid/callback', ...);
module.exports = router;