fix redirection to 404 page on login (#2086)

Co-authored-by: Peer Richelsen <peeroke@gmail.com>
pull/2084/head^2
Hariom Balhara 2022-03-09 20:17:02 +05:30 committed by GitHub
parent 0f27385c17
commit 89f86e2c84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -58,8 +58,12 @@ export default function Login({
const telemetry = useTelemetry();
const callbackUrl =
typeof router.query?.callbackUrl === "string" ? `${WEBSITE_URL}/${router.query.callbackUrl}` : "/";
let callbackUrl = typeof router.query?.callbackUrl === "string" ? router.query.callbackUrl : "/";
// If not absolute URL, make it absolute
if (!/^https?:\/\//.test(callbackUrl)) {
callbackUrl = `${WEBSITE_URL}/${callbackUrl}`;
}
const LoginFooter = (
<span>