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,13 +232,17 @@ export const loginCallbackRouteHandler = async (req, res, redirectType = 'web')
} }
} }
res.redirect( if (redirectType === 'web') {
config.app.urlClient + res.redirect(redirectUri);
'/applaunch?redirect=' + } else {
encodeURIComponent(redirectUri) + res.redirect(
'&redirectType=' + config.app.urlClient +
redirectType '/applaunch?redirect=' +
); encodeURIComponent(redirectUri) +
'&redirectType=' +
redirectType
);
}
}; };
const createOrUpdateUser = async (userInfo) => { const createOrUpdateUser = async (userInfo) => {