File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -620,11 +620,22 @@ AuthorizeHandler.prototype.getClient = function(request) {
620620 throw new InvalidClientError ( 'Invalid client: missing client `grants`' ) ;
621621 }
622622
623- if ( request . query . response_type === 'code' && ! _ . includes ( client . grants , 'authorization_code' ) ) {
623+ let responseTypeTemp = request . query . response_type . split ( ' ' ) ;
624+
625+
626+ if ( responseTypeTemp . includes ( 'code' ) && ! _ . includes ( client . grants , 'authorization_code' ) ) {
627+ throw new UnauthorizedClientError ( 'Unsupported grant type: `grant_type` is invalid' ) ;
628+ }
629+
630+ if ( responseTypeTemp . includes ( 'token' ) && ! _ . includes ( client . grants , 'implicit' ) ) {
631+ throw new UnauthorizedClientError ( 'Unsupported grant type: `grant_type` is invalid' ) ;
632+ }
633+
634+ if ( responseTypeTemp . includes ( 'id_token' ) && ! _ . includes ( client . response_types , 'id_token' ) ) {
624635 throw new UnauthorizedClientError ( 'Unsupported grant type: `grant_type` is invalid' ) ;
625636 }
626637
627- if ( request . query . response_type === 'token' && ! _ . includes ( client . grants , 'implicit ' ) ) {
638+ if ( ( responseTypeTemp . includes ( 'code' ) && responseTypeTemp . length > 1 ) && ! _ . includes ( client . grants , 'hybrid ' ) ) {
628639 throw new UnauthorizedClientError ( 'Unsupported grant type: `grant_type` is invalid' ) ;
629640 }
630641
You can’t perform that action at this time.
0 commit comments