Merge commit from fork

This commit is contained in:
Gabriele
2026-02-01 15:05:19 +01:00
committed by GitHub
parent f1a6e409cb
commit 1f94d7d1bc

View File

@@ -1,5 +1,6 @@
import { DebugLogger } from '@affine/debug';
import { type LoaderFunction, Navigate, useLoaderData } from 'react-router-dom';
import { escapeRegExp } from 'lodash-es';
const trustedDomain = [
'google.com',
@@ -41,7 +42,7 @@ export const loader: LoaderFunction = async ({ request }) => {
if (
target.hostname === window.location.hostname ||
trustedDomain.some(domain =>
new RegExp(`.?${domain}$`).test(target.hostname)
new RegExp(`(^|\\.)${escapeRegExp(domain)}$`).test(target.hostname)
)
) {
location.href = redirectUri;