Fix jwt-token

This commit is contained in:
2025-09-16 21:45:06 +02:00
parent 0a6ab8772b
commit ec9e40f028

View File

@@ -262,7 +262,21 @@ router.post('/login', async (req, res, next) => {
* POST /auth/register
* Universal registration endpoint that routes to appropriate provider
*/
router.post('/register', validateRequest(registerSchema), ipRestriction.checkIPRestriction.bind(ipRestriction), async (req, res, next) => {
router.post('/register', validateRequest(registerSchema), async (req, res, next) => {
// Set test models if available (for testing)
if (global.__TEST_MODELS__) {
ipRestriction.setModels(global.__TEST_MODELS__);
}
// Apply IP restriction check
await new Promise((resolve, reject) => {
ipRestriction.checkIPRestriction(req, res, (err) => {
if (err) reject(err);
else resolve();
});
});
// Continue with registration if IP check passed
try {
// Determine tenant
const tenantId = await multiAuth.determineTenant(req);