Add chrome-extension as allowable domain for auth redirect URLs

This commit is contained in:
Joshen Lim committed 2022-09-26 22:47:12 +08:00
1 parent f5584dcca4
commit f79185257b
1 file changed
+3 -1
@@ -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'
)