Skip to content

Commit

Permalink
fix: jsonwebtoken interface change
Browse files Browse the repository at this point in the history
jsonwebtoken interface changed from string to an enum.

BREAKING CHANGE: Algorithm property changes type from string to jsonwebtoken Algorithm
  • Loading branch information
niallmccullagh committed Apr 22, 2020
1 parent 239c203 commit 2633ee3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.ts
@@ -1,4 +1,4 @@
import { verify, decode, VerifyOptions, JsonWebTokenError } from 'jsonwebtoken';
import { verify, decode, VerifyOptions, Algorithm, VerifyErrors } from 'jsonwebtoken';
import {
AuthenticationSuccess,
ExegesisPluginContext,
Expand All @@ -13,7 +13,7 @@ const log = debug('exegesis-cognito');

export interface Options {
jwks: Jwks;
algorithms?: string[];
algorithms?: Algorithm[];
audience?: string | string[];
clockTolerance?: number;
issuer?: string | string[];
Expand Down Expand Up @@ -158,7 +158,7 @@ function createAuthenticator(options: Options) : Authenticator {
verify(token,
pem,
verifyOptions,
(err: JsonWebTokenError, decoded: string | object) => {
(err: VerifyErrors | null, decoded: object | undefined) => {
if (err) {
log('Failed to verify', err);
done(null, generateErrorResult(err.message));
Expand Down

0 comments on commit 2633ee3

Please sign in to comment.