From 9b0db09b6c48368ef50569244b8c0cde00785584 Mon Sep 17 00:00:00 2001 From: tophf Date: Thu, 3 Feb 2022 13:06:29 +0300 Subject: [PATCH] use hardcoded redirect_uri fallback (#1399) --- background/token-manager.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/background/token-manager.js b/background/token-manager.js index c50090ef..b5756339 100644 --- a/background/token-manager.js +++ b/background/token-manager.js @@ -44,9 +44,6 @@ const tokenMan = (() => { clientSecret: '9Pj=TpsrStq8K@1BiwB9PIWLppM:@s=w', authURL: 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize', tokenURL: 'https://login.microsoftonline.com/common/oauth2/v2.0/token', - redirect_uri: FIREFOX ? - 'https://clngdbkpkpeebahjckkjfobafhncgmne.chromiumapp.org/' : - 'https://' + location.hostname + '.chromiumapp.org/', scopes: ['Files.ReadWrite.AppFolder', 'offline_access'], }, userstylesworld: { @@ -60,6 +57,7 @@ const tokenMan = (() => { }, }; const NETWORK_LATENCY = 30; // seconds + const DEFAULT_REDIRECT_URI = 'https://clngdbkpkpeebahjckkjfobafhncgmne.chromiumapp.org/'; let alwaysUseTab = FIREFOX ? false : null; @@ -153,7 +151,7 @@ const tokenMan = (() => { const query = { response_type: provider.flow, client_id: provider.clientId, - redirect_uri: provider.redirect_uri || chrome.identity.getRedirectURL(), + redirect_uri: provider.redirect_uri || DEFAULT_REDIRECT_URI, state, }; if (provider.scopes) {