Fix hubspot callback (#3195)

Co-authored-by: Leo Giovanetti <[email protected]>
This commit is contained in:
Hariom BalharaandLeo Giovanetti authored and GitHub committed 2022-06-30 07:01:07 +00:00
1 parent 53bbbf793d
commit 1469b856a6
2 files changed
+7 -2

No files matched your search

+4 -1
View File
@@ -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");
}