OSDN Git Service

Version 0.6.160, fix X.Net.
[pettanr/clientJs.git] / 0.6.x / js / 06_net / 10_XOAuth2.js
index ef18be5..3564a13 100644 (file)
@@ -1,4 +1,5 @@
 
+//{+oauth2"OAuth2 サービスの定義"(OAuth2外部サービスを定義し、認可プロセス・xhrの署名を自動化します)[+xhr]
 var X_NET_OAUTH2_detection      = new Function( 'w', 'try{return w.location.search}catch(e){}' ),
        X_NET_OAUTH2_authorizationWindow,
        X_NET_OAUTH2_authorizationTimerID;
@@ -259,7 +260,7 @@ function X_Net_OAuth2_authorizationCode( oauth2, pair ){
 };
 
 function X_Net_OAuth2_responceHandler( e ){
-       var data = e.data,
+       var data = e.response,
                pair = X_Pair_get( this ),
                isRefresh = pair.oauth2State === 3;
        
@@ -270,13 +271,13 @@ function X_Net_OAuth2_responceHandler( e ){
                        if( isRefresh && data.error ){
                                _removeRefreshToken( this );
                                pair.oauth2State = 0;
-                               this[ 'asyncDispatch' ]( { type : X_EVENT_ERROR, message : 'Refresh access token error.' + data.error, data : data } );
+                               this[ 'asyncDispatch' ]( { type : X_EVENT_ERROR, message : 'Refresh access token error.' } );
                                this[ 'asyncDispatch' ]( X_EVENT_NEED_AUTH );
                                return;
                        } else
                        if( data.error ){
                                pair.oauth2State = 0;
-                               this[ 'asyncDispatch' ]( { type : X_EVENT_ERROR, message : 'Get new access token error.' + data.error, data : data } );
+                               this[ 'asyncDispatch' ]( { type : X_EVENT_ERROR, message : 'Get new access token error.' } );
                                this[ 'asyncDispatch' ]( X_EVENT_NEED_AUTH );
                                return;
                        };
@@ -399,3 +400,4 @@ function updateLocalStorage( cmd, that, name, value ){
        return pair[ name ];
 };
 
+//}+oauth2
\ No newline at end of file