File tree 1 file changed +6
-1
lines changed 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() {
160
160
*/
161
161
162
162
AuthorizeHandler . prototype . getClient = function ( request ) {
163
+ const self = this ;
163
164
const clientId = request . body . client_id || request . query . client_id ;
164
165
165
166
if ( ! clientId ) {
@@ -193,7 +194,11 @@ AuthorizeHandler.prototype.getClient = function(request) {
193
194
throw new InvalidClientError ( 'Invalid client: missing client `redirectUri`' ) ;
194
195
}
195
196
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 ) ) {
197
202
throw new InvalidClientError ( 'Invalid client: `redirect_uri` does not match client value' ) ;
198
203
}
199
204
return client ;
You can’t perform that action at this time.
0 commit comments