Fix jwt-token

This commit is contained in:
2025-09-16 21:41:52 +02:00
parent 6692af86dd
commit 72d869628d

View File

@@ -61,6 +61,9 @@ const registerSchema = Joi.object({
// Initialize multi-tenant auth
const multiAuth = new MultiTenantAuth();
// Initialize IP restriction middleware
const ipRestriction = new IPRestrictionMiddleware();
// Session middleware for OAuth state management
router.use(session({
secret: process.env.SESSION_SECRET || 'your-session-secret',
@@ -253,7 +256,7 @@ router.post('/login', async (req, res, next) => {
* POST /auth/register
* Universal registration endpoint that routes to appropriate provider
*/
router.post('/register', validateRequest(registerSchema), async (req, res, next) => {
router.post('/register', validateRequest(registerSchema), ipRestriction.checkIPRestriction.bind(ipRestriction), async (req, res, next) => {
try {
// Determine tenant
const tenantId = await multiAuth.determineTenant(req);