Skip to content

Commit

Permalink
fix: ensure client is still valid after custom metadata processing
Browse files Browse the repository at this point in the history
  • Loading branch information
panva committed Jul 14, 2020
1 parent 7afe4f3 commit fded7c6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/helpers/client_schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ module.exports = function getSchema(provider) {
};

class Schema {
constructor(metadata, ctx) {
constructor(metadata, ctx, processCustomMetadata = !!configuration.extraClientMetadata.properties.length) {
// unless explicitly provided use token_* values
['revocation', 'introspection'].forEach((endpoint) => {
if (metadata[`${endpoint}_endpoint_auth_method`] === undefined) {
Expand Down Expand Up @@ -334,8 +334,15 @@ module.exports = function getSchema(provider) {
}
}

this.processCustomMetadata(ctx);
if (processCustomMetadata) {
this.processCustomMetadata(ctx);
}

this.ensureStripUnrecognized();

if (processCustomMetadata) {
return new Schema(this, ctx, false);
}
}

invalidate(message, code) { // eslint-disable-line class-methods-use-this, no-unused-vars
Expand Down

0 comments on commit fded7c6

Please sign in to comment.