Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * OAuth request message skeleton for every request.
- * before the final url is generated, it must be run through
- * the oauth Timestamp & Signature generators
- *
- * @constructor
- */
- sd.OAuth2.AuthMessage = function(code) {
- var missing_code = (code === undefined);
- this.parameters = missing_code ? { response_type: 'code', client_id: sd.OAuth2.application_key, redirect_uri: sd.OAuth2.close_url } : (code == 'refresh_token') ? { refresh_token: sd.Prefs.get('refresh_token'), grant_type: 'refresh_token', client_id: sd.OAuth2.application_key, client_secret: sd.OAuth2.application_key_secret, redirect_uri: sd.OAuth2.close_url } : { code: code, grant_type: 'authorization_code', client_id: sd.OAuth2.application_key, client_secret: sd.OAuth2.application_key_secret, redirect_uri: sd.OAuth2.close_url };
- this.action = missing_code ? sd.OAuth2.authorize_url : sd.OAuth2.token_url;
- this.method = missing_code ? 'GET' : 'POST'
- };
Add Comment
Please, Sign In to add comment