From f79185257b96801ac5da014268add4f924143f0b Mon Sep 17 00:00:00 2001 From: Joshen Lim Date: Mon, 26 Sep 2022 22:28:50 +0800 Subject: [PATCH] Add chrome-extension as allowable domain for auth redirect URLs --- studio/components/interfaces/Auth/Auth.constants.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/studio/components/interfaces/Auth/Auth.constants.ts b/studio/components/interfaces/Auth/Auth.constants.ts index dd1aea4b908..08400fdefff 100644 --- a/studio/components/interfaces/Auth/Auth.constants.ts +++ b/studio/components/interfaces/Auth/Auth.constants.ts @@ -18,8 +18,10 @@ const appRegex = // Regex from https://stackoverflow.com/a/18696953/4807782 const localhostRegex = /^(?:^|\s)((https?:\/\/)?(?:localhost|[\w-]+(?:\.[\w-]+)+)(:\d+)?(\/\S*)?)/i +const chromeExtensionRegex = /chrome-extension:\/\/([a-zA-Z]*)/gm + // combine the above regexes export const domainRegex = new RegExp( - `(${baseDomainRegex.source})|(${localhostRegex.source})|(${appRegex.source})`, + `(${baseDomainRegex.source})|(${localhostRegex.source})|(${appRegex.source})|(${chromeExtensionRegex.source})`, 'i' )