diff options
author | Jeremy Andrews <athenian200@outlook.com> | 2022-05-24 16:40:36 -0500 |
---|---|---|
committer | Jeremy Andrews <athenian200@outlook.com> | 2022-05-24 16:40:36 -0500 |
commit | c772d0ef215ebba8feaa5813e1aac9863dbaea9c (patch) | |
tree | d51f9af96d33ad12d036c51a0266768d593228aa | |
parent | 1588077e629baa1c27e03149e39f06c265419e0b (diff) | |
download | uxp-c772d0ef215ebba8feaa5813e1aac9863dbaea9c.tar.gz |
No Issue - Epyrus-related platform changes.
I'm very confident these changes will not impact IceDove-UXP or Pale Moon. What they do is conditionally disable a button that allows people to get a new account from a Mozilla-advertised e-mail provider, and remove the hard-coded OAuth2 keys in favor of a user-controlled preference.
-rw-r--r-- | mailnews/base/prefs/content/accountcreation/emailWizard.xul | 2 | ||||
-rw-r--r-- | mailnews/base/util/OAuth2Providers.jsm | 24 |
2 files changed, 16 insertions, 10 deletions
diff --git a/mailnews/base/prefs/content/accountcreation/emailWizard.xul b/mailnews/base/prefs/content/accountcreation/emailWizard.xul index 261545671e..0ffb5f9459 100644 --- a/mailnews/base/prefs/content/accountcreation/emailWizard.xul +++ b/mailnews/base/prefs/content/accountcreation/emailWizard.xul @@ -392,11 +392,13 @@ <spacer flex="1" /> <hbox id="buttons_area"> <hbox id="left_buttons_area" align="center" pack="start"> +#ifndef ATH_EPYRUS <button id="provisioner_button" label="&switch-to-provisioner.label;" accesskey="&switch-to-provisioner.accesskey;" class="larger-button" oncommand="gEmailConfigWizard.onSwitchToProvisioner();"/> +#endif <button id="manual-edit_button" label="&manual-edit.label;" accesskey="&manual-edit.accesskey;" diff --git a/mailnews/base/util/OAuth2Providers.jsm b/mailnews/base/util/OAuth2Providers.jsm index 37a750f46f..7ce00542cf 100644 --- a/mailnews/base/util/OAuth2Providers.jsm +++ b/mailnews/base/util/OAuth2Providers.jsm @@ -9,6 +9,13 @@ var EXPORTED_SYMBOLS = ["OAuth2Providers"]; var {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components; +Cu.import("resource://gre/modules/XPCOMUtils.jsm"); +Cu.import("resource://gre/modules/Services.jsm"); + +XPCOMUtils.defineLazyGetter(this, "gPrefService", function() { + return Services.prefs; +}); + // map of hostnames to [issuer, scope] var kHostnames = new Map([ ["imap.googlemail.com", ["accounts.google.com", "https://mail.google.com/"]], @@ -22,21 +29,18 @@ var kHostnames = new Map([ // map of issuers to appKey, appSecret, authURI, tokenURI -// For the moment, these details are hard-coded, since Google does not -// provide dynamic client registration. Don't copy these values for your -// own application--register it yourself. This code (and possibly even the -// registration itself) will disappear when this is switched to dynamic -// client registration. +// For the moment, these details are user-provided, since there is no way for +// unverified applications to get a proper OAuth2 key. var kIssuers = new Map ([ ["accounts.google.com", [ - '406964657835-aq8lmia8j95dhl1a2bvharmfk3t1hgqj.apps.googleusercontent.com', - 'kSmqreRr0qwBWJgbf5Y-PjSU', + gPrefService.getCharPref("oauth2.google.clientid"), + gPrefService.getCharPref("oauth2.google.clientsecret"), 'https://accounts.google.com/o/oauth2/auth', - 'https://www.googleapis.com/oauth2/v3/token' + 'https://oauth2.googleapis.com/token' ]], ["o2.mail.ru", [ - 'thunderbird', - 'I0dCAXrcaNFujaaY', + gPrefService.getCharPref("oauth2.mailru.clientid"), + gPrefService.getCharPref("oauth2.mailru.clientsecret"), 'https://o2.mail.ru/login', 'https://o2.mail.ru/token' ]], |