Skip to content

Commit

Permalink
N21-844 changes migration redirect (#3278)
Browse files Browse the repository at this point in the history
  • Loading branch information
arnegns authored Aug 24, 2023
1 parent 8f3d813 commit e181d91
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions helpers/authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -408,22 +408,6 @@ const getMigrationStatus = async (req, res, userId, accessToken) => {
return migration;
};

const getMigrationRedirect = (res, migration) => {
const {
targetSystemId,
mandatorySince,
} = migration;

const queryString = new URLSearchParams({
targetSystem: targetSystemId,
mandatory: !!mandatorySince,
});

const redirect = redirectHelper.joinPathWithQuery('/migration', queryString.toString());

return redirect;
};

// eslint-disable-next-line consistent-return
const loginUser = async (req, res, strategy, payload, postLoginRedirect, systemName) => {
let accessToken;
Expand Down Expand Up @@ -451,9 +435,7 @@ const loginUser = async (req, res, strategy, payload, postLoginRedirect, systemN
setCookie(res, 'jwt', accessToken);

if (migration) {
const migrationRedirect = getMigrationRedirect(res, migration);

res.redirect(migrationRedirect);
res.redirect('/migration');
} else {
const queryString = new URLSearchParams();

Expand Down

0 comments on commit e181d91

Please sign in to comment.