Fix jwt-token
This commit is contained in:
@@ -262,7 +262,21 @@ 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), 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 {
|
try {
|
||||||
// Determine tenant
|
// Determine tenant
|
||||||
const tenantId = await multiAuth.determineTenant(req);
|
const tenantId = await multiAuth.determineTenant(req);
|
||||||
|
|||||||
Reference in New Issue
Block a user