OSDN Git Service

Version 0.6.150, fix X.Net.
[pettanr/clientJs.git] / 0.6.x / js / 06_net / 10_XOAuth2.js
index f11bb13..e43d508 100644 (file)
@@ -40,6 +40,8 @@ X[ 'OAuth2' ] = X_EventDispatcher[ 'inherits' ](
                                
                                obj.onAuthError   = X_NET_OAUTH2_onXHR401Error;
                                obj.updateRequest = X_NET_OAUTH2_updateRequest;
+                               
+                               // TODO kill の cancel
                        },
 
                        'authState' : function(){
@@ -58,10 +60,10 @@ X[ 'OAuth2' ] = X_EventDispatcher[ 'inherits' ](
                                X_NET_OAUTH2_authorizationWindow = window.open(
                                        pair[ 'authorizeEndpoint' ] + '?' + X_URL_objToParam(
                                                {
-                                                       response_type : 'code',
-                                                       client_id     : pair[ 'clientID' ],
-                                                       redirect_uri  : tpair[ 'redirectURI' ],
-                                                       scope         : ( pair[ 'scopes' ] || []).join(' ')
+                                                       'response_type' : 'code',
+                                                       'client_id'     : pair[ 'clientID' ],
+                                                       'redirect_uri'  : tpair[ 'redirectURI' ],
+                                                       'scope'         : ( pair[ 'scopes' ] || []).join(' ')
                                                }
                                        ), 'oauthauthorize',
                                        'width=' + pair[ 'authorizeWindowWidth' ]
@@ -250,7 +252,7 @@ function X_NET_OAUTH2_onXHR401Error( oauth2 ){
        if ((( bearerParams && bearerParams.indexOf( ' error="invalid_token"' ) !== -1 ) || !headersExposed) && _getRefreshToken( oauth2 ) ) {
                _removeAccessToken( oauth2 ); // It doesn't work any more.
                pair.oauth2State = 2;
-               oauth2.refreshToken();
+               oauth2[ 'refreshToken' ]();
        } else
        if (!headersExposed && !_getRefreshToken( oauth2 )) {
                pair.oauth2State = 0;