Skip to content

Commit

Permalink
fix: use correct keystore select method for paseto access tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
panva committed Jul 18, 2021
1 parent 7371a84 commit ce394bc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/models/formats/paseto.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ module.exports = (provider, { opaque }) => {
}
} else if (purpose === 'public') {
if (version === 1) {
[key] = keystore.selectForVerify({ alg: 'PS384', kid });
[key] = keystore.selectForSign({ alg: 'PS384', kid });
} else if (version === 2) {
[key] = keystore.selectForVerify({ alg: 'EdDSA', crv: 'Ed25519', kid });
[key] = keystore.selectForSign({ alg: 'EdDSA', crv: 'Ed25519', kid });
}
if (!key) {
throw new Error('resolved Resource Server paseto configuration has no corresponding key in the provider\'s keystore');
Expand Down

0 comments on commit ce394bc

Please sign in to comment.