File tree Expand file tree Collapse file tree 5 files changed +48
-6
lines changed Expand file tree Collapse file tree 5 files changed +48
-6
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " oauth-js" ,
3- "version" : " 0.4.4 " ,
3+ "version" : " 0.4.5 " ,
44 "main" : " dist/oauth.min.js" ,
55 "description" : " OAuth that just works" ,
66 "license" : " Apache-2.0" ,
Original file line number Diff line number Diff line change @@ -52,6 +52,19 @@ module.exports = (Materia) ->
5252 res = {}
5353 for i of tokens
5454 res[i] = tokens[i]
55+
56+ res .toJson = ->
57+ a = {}
58+ a .access_token = res .access_token if res .access_token ?
59+ a .oauth_token = res .oauth_token if res .oauth_token ?
60+ a .oauth_token_secret = res .oauth_token_secret if res .oauth_token_secret ?
61+ a .expires_in = res .expires_in if res .expires_in ?
62+ a .token_type = res .token_type if res .token_type ?
63+ a .id_token = res .id_token if res .id_token ?
64+ a .provider = res .provider if res .provider ?
65+ a .email = res .email if res .email ?
66+ return a
67+
5568 res .get = make_res (" GET" )
5669 res .post = make_res (" POST" )
5770 res .put = make_res (" PUT" )
Original file line number Diff line number Diff line change 22module . exports = {
33 oauthd_url : "https://oauth.io" ,
44 oauthd_api : "https://oauth.io/api" ,
5- version : "web-0.4.4 " ,
5+ version : "web-0.4.5 " ,
66 options : { }
77} ;
88
@@ -198,6 +198,35 @@ module.exports = function(Materia) {
198198 for ( i in tokens ) {
199199 res [ i ] = tokens [ i ] ;
200200 }
201+ res . toJson = function ( ) {
202+ var a ;
203+ a = { } ;
204+ if ( res . access_token != null ) {
205+ a . access_token = res . access_token ;
206+ }
207+ if ( res . oauth_token != null ) {
208+ a . oauth_token = res . oauth_token ;
209+ }
210+ if ( res . oauth_token_secret != null ) {
211+ a . oauth_token_secret = res . oauth_token_secret ;
212+ }
213+ if ( res . expires_in != null ) {
214+ a . expires_in = res . expires_in ;
215+ }
216+ if ( res . token_type != null ) {
217+ a . token_type = res . token_type ;
218+ }
219+ if ( res . id_token != null ) {
220+ a . id_token = res . id_token ;
221+ }
222+ if ( res . provider != null ) {
223+ a . provider = res . provider ;
224+ }
225+ if ( res . email != null ) {
226+ a . email = res . email ;
227+ }
228+ return a ;
229+ } ;
201230 res . get = make_res ( "GET" ) ;
202231 res . post = make_res ( "POST" ) ;
203232 res . put = make_res ( "PUT" ) ;
Original file line number Diff line number Diff line change 11{
22 "name" : " oauthio-web" ,
3- "version" : " 0.4.4 " ,
3+ "version" : " 0.4.5 " ,
44 "description" : " OAuth that just works" ,
55 "main" : " dist/oauth.min.js" ,
66 "repository" : {
You can’t perform that action at this time.
0 commit comments