@@ -114,16 +114,6 @@ describe('TokenHandler integration', function() {
114114 handler . alwaysIssueNewRefreshToken . should . equal ( true ) ;
115115 } ) ;
116116
117- it ( 'should set the `PKCEEnabled` to true' , function ( ) {
118- var model = {
119- getClient : function ( ) { } ,
120- saveToken : function ( ) { }
121- } ;
122- var handler = new TokenHandler ( { accessTokenLifetime : 123 , model : model , refreshTokenLifetime : 120 , PKCEEnabled : true } ) ;
123- 124- handler . PKCEEnabled . should . equal ( true ) ;
125- } ) ;
126- 127117 it ( 'should set the `extendedGrantTypes`' , function ( ) {
128118 var extendedGrantTypes = { foo : 'bar' } ;
129119 var model = {
@@ -595,59 +585,6 @@ describe('TokenHandler integration', function() {
595585 . catch ( should . fail ) ;
596586 } ) ;
597587 } ) ;
598- describe ( 'with PKCE enabled' , function ( ) {
599- it ( 'should return a client with `isPublic` parameter' , function ( ) {
600- var client = { id : 12345 , grants : [ ] , isPublic : true } ;
601- var model = {
602- getClient : function ( ) { return client ; } ,
603- saveToken : function ( ) { }
604- } ;
605- 606- var handler = new TokenHandler ( {
607- accessTokenLifetime : 120 ,
608- model : model ,
609- refreshTokenLifetime : 120 ,
610- PKCEEnabled : true
611- } ) ;
612- var request = new Request ( { body : { client_id : 'foo' , client_secret : 'baz' , grant_type : 'authorization_code' } , headers : { } , method : { } , query : { } } ) ;
613- 614- return handler . getClient ( request )
615- . then ( function ( data ) {
616- data . should . equal ( client ) ;
617- } )
618- . catch ( should . fail ) ;
619- } ) ;
620- it ( 'should throw an error if `client.isPublic` is invalid' , function ( ) {
621- var model = {
622- getClient : function ( ) { return { id : 123 , grants : [ ] , isPublic : 'foo' } ; } ,
623- saveToken : function ( ) { }
624- } ;
625- var handler = new TokenHandler ( { accessTokenLifetime : 120 , model : model , refreshTokenLifetime : 120 , PKCEEnabled : true } ) ;
626- var request = new Request ( { body : { client_id : 12345 , client_secret : 'secret' } , headers : { } , method : { } , query : { } } ) ;
627- 628- return handler . getClient ( request )
629- . then ( should . fail )
630- . catch ( function ( e ) {
631- e . should . be . an . instanceOf ( ServerError ) ;
632- e . message . should . equal ( 'Server error: invalid client, `isPublic` must be a boolean' ) ;
633- } ) ;
634- } ) ;
635- it ( 'should throw an error if `client.isPublic` is missing' , function ( ) {
636- var model = {
637- getClient : function ( ) { return { id : 123 , grants : [ ] } ; } ,
638- saveToken : function ( ) { }
639- } ;
640- var handler = new TokenHandler ( { accessTokenLifetime : 120 , model : model , refreshTokenLifetime : 120 , PKCEEnabled : true } ) ;
641- var request = new Request ( { body : { client_id : 12345 , client_secret : 'secret' } , headers : { } , method : { } , query : { } } ) ;
642- 643- return handler . getClient ( request )
644- . then ( should . fail )
645- . catch ( function ( e ) {
646- e . should . be . an . instanceOf ( ServerError ) ;
647- e . message . should . equal ( 'Server error: missing client `isPublic`' ) ;
648- } ) ;
649- } ) ;
650- } ) ;
651588
652589 it ( 'should support promises' , function ( ) {
653590 var model = {
0 commit comments