Skip to content

Commit

Permalink
🐛 support new OpenAI ChatGPT OAuth subdomains (#402)
Browse files Browse the repository at this point in the history
Signed-off-by: Marc Nuri <[email protected]>
  • Loading branch information
manusa authored May 14, 2024
1 parent 9ac9614 commit 83e8d44
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tab-manager/__tests__/redirect.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@ describe('Tab Manager Redirect module test suite', () => {
});
});
describe('OpenAI OAuth', () => {
test('From Slack to OAuth, should return false', () => {
test.each(['auth0', 'auth'])('From Slack to OAuth (%s), should return false', subdomain => {
// Given
mockBrowserViewUrl = 'https://alberto.slack.com';
// When
const result = redirect.shouldOpenInExternalBrowser(mockBrowserView,
new URL('https://auth0.openai.com/u/login/identifier?state=1337'));
new URL(`https://${subdomain}.openai.com/u/login/identifier?state=1337`));
// Then
expect(result).toBe(false);
});
Expand Down
1 change: 1 addition & 0 deletions src/tab-manager/redirect.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const isOAuth = matchUrls([
/^https:\/\/account\.live\.com\/.*/, // NOSONAR
/^https:\/\/login\.live\.com\/.*/, // NOSONAR
/^https:\/\/login\.microsoftonline\.com\/.*/, // NOSONAR
/^https:\/\/auth\.openai\.com\/.*/, // NOSONAR
/^https:\/\/auth0\.openai\.com\/.*/, // NOSONAR
/^https:\/\/auth\.redhat\.com\/auth\/.*/, // NOSONAR
/^https:\/\/sso\.secureserver\.net\/.*/, // NOSONAR
Expand Down

0 comments on commit 83e8d44

Please sign in to comment.