h = pair[ 'authorizeWindowHeight' ] || 500;
X_NET_OAUTH2_authorizationWindow = window.open(
- url + ( ( url.indexOf( '?' ) !== -1 ) ? '&' : '?' ) + X_URL_objToParam(
+ X_URL_create( url,
{
'response_type' : 'code',
'client_id' : pair[ 'clientID' ],
'redirect_uri' : pair[ 'redirectURI' ],
'scope' : ( pair[ 'scopes' ] || []).join(' ')
}
- ), 'oauthauthorize',
+ ),
+ 'oauthauthorize',
'width=' + w
+ ',height=' + h
+ ',left=' + ( screen.width - w ) / 2
headers;
if( token && mechanism === 'param' ){
- request[ 'url' ] = url + ((url.indexOf('?') !== -1) ? '&' : '?') + 'bearer_token=' + encodeURIComponent( token );
+ request[ 'url' ] = X_URL_create( url, { 'bearer_token' : encodeURIComponent( token ) } );
};
if( token && ( !mechanism || mechanism === 'header' ) ){