3

I'm using Google Oauth2 Javascript in a JSP application.

 <script src="https://apis.google.com/js/client.js"></script>

 function googleOAuth(idx) {
alert ("Please ensure that popup windows are enabled in your browser. You will      authenticate directly with Google in another window.");
   var config = {
    'client_id': '<%=googleClientId%>',
    'scope': 'https://mail.google.com/ https://www.googleapis.com/auth/userinfo.email',
    'response_type': 'token',
    'immediate': false
  };
  gapi.auth.authorize(config, function() {
     var token = gapi.auth.getToken();
   /// ...use token

  });
  }

My app was working fine till yesterday, today its failing to authorize and the Chrome console says:

Uncaught TypeError: undefined is not a function at line cb=gapi.loaded_0:223 The handler function has not executed yet. Line 223 has the following:

var f=c.popup,g=c.after_redirect;f&&"keep_open"!=g&&(0,_.Uu)(window,f)

and I don't see how g&&(0,_.Uu)(window,f) can be valid JS.

Is anyone else seeing this too?

2
  • I ran into this problem as well and thought I had made a bad change on my own, but it turns out I wasn't alone. I should point out, however, that g&&(0,_.Uu)(window,f) is valid JavaScript. It makes use of the comma operator, which returns the value of the second operand. In order for it to make sense here, the value of _.Uu should be a function, because it is immediately called after evaluating the expression. In order to see that g&&(0,_.Uu)(window,f) is indeed valid, try running it in your console after first executing var g=true,_={Uu:alert},f=null. Commented Sep 4, 2013 at 21:16
  • I see; You're right (though I suspect the intended usage is g && g(0, _.Uu)(window,f). This idiom is used in several places). Thanks. Commented Sep 4, 2013 at 22:58

1 Answer 1

3

It's a bug. Also reported: one two

Google as I know is fixing now.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.