Commit edb94f555d18cd95831bb8c3b5963c7bea44a089
- Diff rendering mode:
- inline
- side by side
swtr/static/js/oauth.js
(4 / 4)
  | |||
2 | 2 | ||
3 | 3 | var Oauth = function(options) { | |
4 | 4 | // all necessary params provided? | |
5 | if(!options.hasOwnProperty('app_id') || !options.hasOwnProperty('app_secret') || | ||
6 | !options.hasOwnProperty('redirect_uri') || !options.hasOwnProperty('scopes') || | ||
5 | if(!options.hasOwnProperty('app_id') || | ||
6 | !options.hasOwnProperty('redirect_uri') || | ||
7 | !options.hasOwnProperty('scopes') || | ||
7 | 8 | !options.hasOwnProperty('endpoint')) { | |
8 | 9 | ||
9 | throw new Error('All of the - app_id, app_secret, redirect_uri, scopes'+ | ||
10 | throw new Error('All of the - app_id, redirect_uri, scopes'+ | ||
10 | 11 | ', endpoint - parameters must be provided'); | |
11 | 12 | return; | |
12 | 13 | } | |
… | … | ||
20 | 20 | } | |
21 | 21 | ||
22 | 22 | this.app_id = options.app_id; | |
23 | this.app_secret = options.app_secret; | ||
24 | 23 | this.redirect_uri = options.redirect_uri; | |
25 | 24 | this.scopes = options.scopes.split(','); | |
26 | 25 | this.endpoint = options.endpoint; |
swtr/static/js/swtmaker.js
(0 / 1)
  | |||
291 | 291 | // initialize the oauth stuff | |
292 | 292 | this.oauth = new Oauth({ | |
293 | 293 | app_id: swtr.app_id, | |
294 | app_secret: swtr.app_secret, | ||
295 | 294 | endpoint: swtr.swtstoreURL() + swtr.endpoints.auth, | |
296 | 295 | redirect_uri: swtr.oauth_redirect_uri, | |
297 | 296 | scopes: 'email,sweet' |
swtr/templates/index.html
(0 / 1)
  | |||
102 | 102 | swtr.access_token = '{{ access_token }}'; | |
103 | 103 | swtr.refresh_token = '{{ refresh_token }}'; | |
104 | 104 | swtr.app_id = '{{ config.app_id }}'; | |
105 | swtr.app_secret = '{{ config.app_secret }}'; | ||
106 | 105 | swtr.oauth_redirect_uri = '{{ config.redirect_uri }}'; | |
107 | 106 | window.onload = function() { | |
108 | 107 | swtr.init(); |