Refactored login callback route handler to differentiate redirect behavior based on the redirect type, improving flexibility in response handling.
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good

This commit is contained in:
Tom Butcher 2026-06-22 03:02:01 +01:00
parent efb3fdbcb9
commit 759aa1017f

View File

@ -232,6 +232,9 @@ export const loginCallbackRouteHandler = async (req, res, redirectType = 'web')
} }
} }
if (redirectType === 'web') {
res.redirect(redirectUri);
} else {
res.redirect( res.redirect(
config.app.urlClient + config.app.urlClient +
'/applaunch?redirect=' + '/applaunch?redirect=' +
@ -239,6 +242,7 @@ export const loginCallbackRouteHandler = async (req, res, redirectType = 'web')
'&redirectType=' + '&redirectType=' +
redirectType redirectType
); );
}
}; };
const createOrUpdateUser = async (userInfo) => { const createOrUpdateUser = async (userInfo) => {