encode redirect uri

This commit is contained in:
Evert Prants 2022-09-10 12:59:04 +03:00
parent 3ca815690e
commit 4b4cd88698
Signed by: evert
GPG Key ID: 1688DA83D222D0B5

View File

@ -84,7 +84,7 @@ export class LoginController {
const encrypted = await this.token.encryptChallenge(challenge); const encrypted = await this.token.encryptChallenge(challenge);
res.redirect( res.redirect(
`login/verify?challenge=${encrypted}${ `login/verify?challenge=${encrypted}${
redirectTo ? '&redirectTo=' + redirectTo : '' redirectTo ? '&redirectTo=' + encodeURIComponent(redirectTo) : ''
}`, }`,
); );
return; return;
@ -114,7 +114,10 @@ export class LoginController {
}); });
res.redirect( res.redirect(
'/login' + (query.redirectTo ? '?redirectTo=' + query.redirectTo : ''), '/login' +
(query.redirectTo
? '?redirectTo=' + encodeURIComponent(query.redirectTo)
: ''),
); );
return; return;
} }
@ -156,7 +159,10 @@ export class LoginController {
}); });
res.redirect( res.redirect(
'/login' + (query.redirectTo ? '?redirectTo=' + query.redirectTo : ''), '/login' +
(query.redirectTo
? '?redirectTo=' + encodeURIComponent(query.redirectTo)
: ''),
); );
return; return;
} }