Bug 1069816: App name is appended to the document title on Windows and Linux, so authentication failed. r=abr
authorMike de Boer <mdeboer@mozilla.com>
Thu, 09 Oct 2014 16:49:02 +0200
changeset 209691 b197c72ec2c290ad3cc41ae5728c7957adf9b56a
parent 209690 82df8ad2c609a2e5411330eef7954fd36f2aa3d7
child 209692 86abd23340f0196747b9c844d89b161c0507a69b
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersabr
bugs1069816
milestone35.0a1
Bug 1069816: App name is appended to the document title on Windows and Linux, so authentication failed. r=abr Bug 1069816: App name is appended to the document title on Windows and Linux, so authentication failed. r=abr
browser/components/loop/GoogleImporter.jsm
--- a/browser/components/loop/GoogleImporter.jsm
+++ b/browser/components/loop/GoogleImporter.jsm
@@ -217,17 +217,17 @@ this.GoogleImporter.prototype = {
     // The following loops runs as long as the OAuth windows' titlebar doesn't
     // yield a response from the Google service. If an error occurs, the loop
     // will terminate early.
     while (!code) {
       if (!gAuthWindow || gAuthWindow.closed) {
         throw new Error("Popup window was closed before authentication succeeded");
       }
 
-      let matches = gAuthWindow.document.title.match(/(error|code)=(.*)$/);
+      let matches = gAuthWindow.document.title.match(/(error|code)=([^\s]+)/);
       if (matches && matches.length) {
         let [, type, message] = matches;
         gAuthWindow.close();
         gAuthWindow = null;
         if (type == "error") {
           throw new Error("Google authentication failed with error: " + message.trim());
         } else if (type == "code") {
           code = message.trim();