Fix jwt-token
This commit is contained in:
@@ -61,6 +61,9 @@ const registerSchema = Joi.object({
|
|||||||
// Initialize multi-tenant auth
|
// Initialize multi-tenant auth
|
||||||
const multiAuth = new MultiTenantAuth();
|
const multiAuth = new MultiTenantAuth();
|
||||||
|
|
||||||
|
// Initialize IP restriction middleware
|
||||||
|
const ipRestriction = new IPRestrictionMiddleware();
|
||||||
|
|
||||||
// Session middleware for OAuth state management
|
// Session middleware for OAuth state management
|
||||||
router.use(session({
|
router.use(session({
|
||||||
secret: process.env.SESSION_SECRET || 'your-session-secret',
|
secret: process.env.SESSION_SECRET || 'your-session-secret',
|
||||||
@@ -253,7 +256,7 @@ router.post('/login', async (req, res, next) => {
|
|||||||
* POST /auth/register
|
* POST /auth/register
|
||||||
* Universal registration endpoint that routes to appropriate provider
|
* 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 {
|
try {
|
||||||
// Determine tenant
|
// Determine tenant
|
||||||
const tenantId = await multiAuth.determineTenant(req);
|
const tenantId = await multiAuth.determineTenant(req);
|
||||||
|
|||||||
Reference in New Issue
Block a user