Bug 1468069 - fix OAuth credentials being overwritten. r=philipp a=philipp BETA_60_CONTINUATION
authorGeoff Lankow <geoff@darktrojan.net>
Sat, 23 Jun 2018 15:49:48 +1200
branchBETA_60_CONTINUATION
changeset 32017 b13c03b7342b
parent 32016 f06066471eae
child 32018 219d1dcb42bb
push id384
push userclokep@gmail.com
push dateTue, 26 Jun 2018 01:38:29 +0000
reviewersphilipp, philipp
bugs1468069
Bug 1468069 - fix OAuth credentials being overwritten. r=philipp a=philipp MozReview-Commit-ID: Cz2iiZ3EyJ5
calendar/base/modules/utils/calAuthUtils.jsm
--- a/calendar/base/modules/utils/calAuthUtils.jsm
+++ b/calendar/base/modules/utils/calAuthUtils.jsm
@@ -218,17 +218,21 @@ var calauth = {
      * require it. This is a fallback for compatibility only and should be removed a few versions
      * after Lightning 6.2
      *
      * @param {String} aOrigin      The hostname or origin to check
      * @return {String}             The origin uri
      */
     _ensureOrigin: function(aOrigin) {
         try {
-            return Services.io.newURI(aOrigin).prePath;
+            let {prePath, spec} = Services.io.newURI(aOrigin);
+            if (prePath == "oauth:") {
+                return spec;
+            }
+            return prePath;
         } catch (e) {
             return "https://" + aOrigin;
         }
     },
 
     /**
      * Helper to insert/update an entry to the password manager.
      *