fix redirection to 404 page on login (#2086)

Co-authored-by: Peer Richelsen <peeroke@gmail.com>
This commit is contained in:
Hariom Balhara
2022-03-09 20:17:02 +05:30
committed by GitHub
parent 0f27385c17
commit 89f86e2c84

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>