oidc-provider
Version:
OAuth 2.0 Authorization Server implementation for Node.js with OpenID Connect
18 lines (15 loc) • 321 B
JavaScript
export default (superclass) => class extends superclass {
static get IN_PAYLOAD() {
return [
...super.IN_PAYLOAD,
'consumed',
];
}
async consume() {
await this.adapter.consume(this.jti);
this.emit('consumed');
}
get isValid() {
return !this.consumed && !this.isExpired;
}
};