File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -160,6 +160,7 @@ AuthorizeHandler.prototype.getAuthorizationCodeLifetime = function() {
160160 */
161161
162162AuthorizeHandler . prototype . getClient = function ( request ) {
163+ const self = this ;
163164 const clientId = request . body . client_id || request . query . client_id ;
164165
165166 if ( ! clientId ) {
@@ -193,7 +194,11 @@ AuthorizeHandler.prototype.getClient = function(request) {
193194 throw new InvalidClientError ( 'Invalid client: missing client `redirectUri`' ) ;
194195 }
195196
196- if ( redirectUri && ! client . redirectUris . includes ( redirectUri ) ) {
197+ if ( redirectUri && typeof self . model . validateRedirectUri === 'function' ) {
198+ if ( self . model . validateRedirectUri ( redirectUri , client . redirectUris ) ) {
199+ throw new InvalidClientError ( 'Invalid client: `redirect_uri` does not match client value' ) ;
200+ }
201+ } else if ( redirectUri && ! client . redirectUris . includes ( redirectUri ) ) {
197202 throw new InvalidClientError ( 'Invalid client: `redirect_uri` does not match client value' ) ;
198203 }
199204 return client ;
You can’t perform that action at this time.
0 commit comments