parent
53bbbf793d
commit
1469b856a6
|
@ -71,7 +71,9 @@ export default function Login({
|
|||
callbackUrl = `${WEBAPP_URL}/${callbackUrl}`;
|
||||
}
|
||||
|
||||
callbackUrl = getSafeRedirectUrl(callbackUrl);
|
||||
const safeCallbackUrl = getSafeRedirectUrl(callbackUrl);
|
||||
|
||||
callbackUrl = safeCallbackUrl || "";
|
||||
|
||||
const LoginFooter = (
|
||||
<span>
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
import { CONSOLE_URL, WEBAPP_URL, WEBSITE_URL } from "@calcom/lib/constants";
|
||||
|
||||
// It ensures that redirection URL safe where it is accepted through a query params or other means where user can change it.
|
||||
export const getSafeRedirectUrl = (url: string = "") => {
|
||||
export const getSafeRedirectUrl = (url = "") => {
|
||||
if (!url) {
|
||||
return null;
|
||||
}
|
||||
if (url.search(/^https?:\/\//) === -1) {
|
||||
throw new Error("Pass an absolute URL");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue