2
2
mirror of https://github.com/Llewellynvdm/nativefier.git synced 2024-11-04 20:38:03 +00:00

Add Apple ID to automatically-internal login pages (#1146)

Used by Notion, for example. TLDs other than `.com` don't appear to exist.
This commit is contained in:
Alec Mev 2021-04-01 23:03:07 +01:00 committed by GitHub
parent 4298d2da06
commit d0ab749bd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -83,6 +83,7 @@ const testLoginPages = [
'https://twitter.co.uk/oauth/authenticate',
'https://twitter.com/oauth/authenticate',
'https://twitter.de/oauth/authenticate',
'https://appleid.apple.com/auth/authorize',
];
test.each(testLoginPages)(
@ -98,6 +99,7 @@ const testNonLoginPages = [
'https://github.com/nativefier/nativefier',
'https://github.com/org/nativefier',
'https://twitter.com/marcoroth_/status/1325938620906287104',
'https://appleid.apple.com/account',
];
test.each(testNonLoginPages)(

View File

@ -19,6 +19,7 @@ export function isWindows(): boolean {
}
function isInternalLoginPage(url: string): boolean {
// Making changes? Remember to update the tests in helpers.test.ts
const internalLoginPagesArray = [
'amazon\\.[a-zA-Z\\.]*/[a-zA-Z\\/]*signin', // Amazon
`facebook\\.[a-zA-Z\\.]*\\/login`, // Facebook
@ -28,6 +29,7 @@ function isInternalLoginPage(url: string): boolean {
'login\\.live\\.[a-zA-Z\\.]*', // Microsoft
'okta\\.[a-zA-Z\\.]*', // Okta
'twitter\\.[a-zA-Z\\.]*/oauth/authenticate', // Twitter
'appleid\\.apple\\.com/auth/authorize', // Apple
];
const regex = RegExp(internalLoginPagesArray.join('|'));
return regex.test(url);