@@ -180,7 +180,10 @@ describe('AuthorizeHandler integration', function() {
180
180
it ( 'should redirect to an error response if a non-oauth error is thrown' , function ( ) {
181
181
var model = {
182
182
getAccessToken : function ( ) {
183
- return { user : { } } ;
183
+ return {
184
+ user : { } ,
185
+ accessTokenExpiresAt : new Date ( new Date ( ) . getTime ( ) + 10000 )
186
+ } ;
184
187
} ,
185
188
getClient : function ( ) {
186
189
return { grants : [ 'authorization_code' ] , redirectUris : [ 'http://example.com/cb' ] } ;
@@ -215,7 +218,10 @@ describe('AuthorizeHandler integration', function() {
215
218
it ( 'should redirect to an error response if an oauth error is thrown' , function ( ) {
216
219
var model = {
217
220
getAccessToken : function ( ) {
218
- return { user : { } } ;
221
+ return {
222
+ user : { } ,
223
+ accessTokenExpiresAt : new Date ( new Date ( ) . getTime ( ) + 10000 )
224
+ } ;
219
225
} ,
220
226
getClient : function ( ) {
221
227
return { grants : [ 'authorization_code' ] , redirectUris : [ 'http://example.com/cb' ] } ;
@@ -251,7 +257,11 @@ describe('AuthorizeHandler integration', function() {
251
257
var client = { grants : [ 'authorization_code' ] , redirectUris : [ 'http://example.com/cb' ] } ;
252
258
var model = {
253
259
getAccessToken : function ( ) {
254
- return { client : client , user : { } } ;
260
+ return {
261
+ client : client ,
262
+ user : { } ,
263
+ accessTokenExpiresAt : new Date ( new Date ( ) . getTime ( ) + 10000 )
264
+ } ;
255
265
} ,
256
266
getClient : function ( ) {
257
267
return client ;
@@ -286,7 +296,10 @@ describe('AuthorizeHandler integration', function() {
286
296
it ( 'should redirect to an error response if `scope` is invalid' , function ( ) {
287
297
var model = {
288
298
getAccessToken : function ( ) {
289
- return { user : { } } ;
299
+ return {
300
+ user : { } ,
301
+ accessTokenExpiresAt : new Date ( new Date ( ) . getTime ( ) + 10000 )
302
+ } ;
290
303
} ,
291
304
getClient : function ( ) {
292
305
return { grants : [ 'authorization_code' ] , redirectUris : [ 'http://example.com/cb' ] } ;
@@ -322,7 +335,10 @@ describe('AuthorizeHandler integration', function() {
322
335
it ( 'should redirect to an error response if `state` is missing' , function ( ) {
323
336
var model = {
324
337
getAccessToken : function ( ) {
325
- return { user : { } } ;
338
+ return {
339
+ user : { } ,
340
+ accessTokenExpiresAt : new Date ( new Date ( ) . getTime ( ) + 10000 )
341
+ } ;
326
342
} ,
327
343
getClient : function ( ) {
328
344
return { grants : [ 'authorization_code' ] , redirectUris : [ 'http://example.com/cb' ] } ;
@@ -355,7 +371,10 @@ describe('AuthorizeHandler integration', function() {
355
371
it ( 'should redirect to an error response if `response_type` is invalid' , function ( ) {
356
372
var model = {
357
373
getAccessToken : function ( ) {
358
- return { user : { } } ;
374
+ return {
375
+ user : { } ,
376
+ accessTokenExpiresAt : new Date ( new Date ( ) . getTime ( ) + 10000 )
377
+ } ;
359
378
} ,
360
379
getClient : function ( ) {
361
380
return { grants : [ 'authorization_code' ] , redirectUris : [ 'http://example.com/cb' ] } ;
@@ -390,7 +409,10 @@ describe('AuthorizeHandler integration', function() {
390
409
it ( 'should fail on invalid `response_type` before calling model.saveAuthorizationCode()' , function ( ) {
391
410
var model = {
392
411
getAccessToken : function ( ) {
393
- return { user : { } } ;
412
+ return {
413
+ user : { } ,
414
+ accessTokenExpiresAt : new Date ( new Date ( ) . getTime ( ) + 10000 )
415
+ } ;
394
416
} ,
395
417
getClient : function ( ) {
396
418
return { grants : [ 'authorization_code' ] , redirectUris : [ 'http://example.com/cb' ] } ;
@@ -426,7 +448,11 @@ describe('AuthorizeHandler integration', function() {
426
448
var client = { grants : [ 'authorization_code' ] , redirectUris : [ 'http://example.com/cb' ] } ;
427
449
var model = {
428
450
getAccessToken : function ( ) {
429
- return { client : client , user : { } } ;
451
+ return {
452
+ client : client ,
453
+ user : { } ,
454
+ accessTokenExpiresAt : new Date ( new Date ( ) . getTime ( ) + 10000 )
455
+ } ;
430
456
} ,
431
457
getClient : function ( ) {
432
458
return client ;
@@ -889,7 +915,10 @@ describe('AuthorizeHandler integration', function() {
889
915
var user = { } ;
890
916
var model = {
891
917
getAccessToken : function ( ) {
892
- return { user : user } ;
918
+ return {
919
+ user : user ,
920
+ accessTokenExpiresAt : new Date ( new Date ( ) . getTime ( ) + 10000 )
921
+ } ;
893
922
} ,
894
923
getClient : function ( ) { } ,
895
924
saveAuthorizationCode : function ( ) { }
0 commit comments