feat(WEB-132): add seamless login flow

This commit is contained in:
Michael Zetterberg
2024-04-10 12:48:44 +02:00
parent 7093a0b2dd
commit 7be4766c00
5 changed files with 71 additions and 10 deletions

View File

@@ -85,8 +85,10 @@ export const config = {
// Assume absolute URL
try {
const parsedUrl = new URL(url)
if (parsedUrl.hostname.endsWith(".scandichotels.com")) {
// Allows **.scandichotels.com
if (
/\.scandichotels\.(dk|de|com|fi|no|se)$/.test(parsedUrl.hostname)
) {
// Allows any subdomains on all top level domains above
return url
} else if (parsedUrl.origin === baseUrl) {
// Allows callback URLs on the same origin