Skip to content

Commit

Permalink
Remove unused redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
dyedwiper committed Jan 31, 2024
1 parent b3d923a commit f4b6de3
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions controllers/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -442,27 +442,6 @@ router.get('/login/success', authHelper.authChecker, async (req, res) => {
return res.redirect(`/firstLogin?redirect=${redirectUrl}`);
}

// if this happens: SSO
const {
accountId,
systemId,
schoolId,
} = res.locals.currentPayload || {};
if (accountId && systemId && schoolId) {
const schools = await LoginSchoolsCache.get(req);
if (schools.length > 0) {
const checkSchool = schools.find((school) => school._id === schoolId);
if (checkSchool && checkSchool.systems) {
const schoolWithSystem = checkSchool.systems.find(
(system) => system._id === systemId,
);
if (schoolWithSystem) {
res.redirect(`/registration/${schoolId}/sso/${accountId}`);
}
}
}
}

const redirectUrl = determineRedirectUrl(req);
res.redirect(redirectUrl);

Expand Down

0 comments on commit f4b6de3

Please sign in to comment.