Fix jwt-token
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user