File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -235,7 +235,7 @@ function useRefreshTokenGrant (done) {
235
235
} ) ;
236
236
}
237
237
238
- self . user = { id : refreshToken . user_id } ;
238
+ self . user = refreshToken . user || { id : refreshToken . user_id } ;
239
239
done ( ) ;
240
240
} ) ;
241
241
} ;
@@ -324,8 +324,8 @@ function saveAccessToken (done) {
324
324
var data = {
325
325
access_token : accessToken ,
326
326
client_id : this . client . client_id ,
327
- user_id : this . user . id ,
328
- expires : expires
327
+ expires : expires ,
328
+ user : this . user
329
329
} ;
330
330
331
331
this . model . saveAccessToken ( data , function ( err ) {
@@ -376,8 +376,8 @@ function saveRefreshToken (done) {
376
376
var data = {
377
377
refresh_token : refreshToken ,
378
378
client_id : this . client . client_id ,
379
- user_id : this . user . id ,
380
- expires : expires
379
+ expires : expires ,
380
+ user : this . user
381
381
} ;
382
382
383
383
this . model . saveAccessToken ( data , function ( err ) {
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " node-oauth2-server" ,
3
3
"description" : " Complete, compliant and well tested module for implementing an OAuth2 Server/Provider with express in node.js" ,
4
- "version" : " 2.0.0-beta " ,
4
+ "version" : " 2.0.0-beta2 " ,
5
5
"keywords" : [
6
6
" oauth" ,
7
7
" oauth2"
Original file line number Diff line number Diff line change @@ -652,7 +652,7 @@ describe('Grant', function() {
652
652
data . access_token . should . be . a ( 'string' ) ;
653
653
data . access_token . should . have . length ( 40 ) ;
654
654
data . client_id . should . equal ( 'thom' ) ;
655
- data . user_id . should . equal ( 1 ) ;
655
+ data . user . id . should . equal ( 1 ) ;
656
656
( + data . expires ) . should . be . within ( 10 , ( + new Date ( ) ) + 3600000 ) ;
657
657
callback ( ) ;
658
658
}
You can’t perform that action at this time.
0 commit comments