Skip to content

Commit 9db83b0

Browse files
authored
Merge pull request #139 from e2forks/master
Resolve #137: `jwt.Options.secret` should also accept `string[]`
2 parents 3638368 + 5420f21 commit 9db83b0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

types/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ declare function jwt(options: jwt.Options): jwt.Middleware;
1111

1212
declare namespace jwt {
1313
export interface Options {
14-
secret: string | Buffer | SecretLoader;
14+
secret: string | string[] | Buffer | Buffer[] | SecretLoader;
1515
key?: string;
1616
tokenKey?: string;
1717
getToken?(ctx: Koa.Context, opts: jwt.Options): string;
@@ -24,7 +24,7 @@ declare namespace jwt {
2424
algorithms?: string[];
2525
}
2626

27-
export type SecretLoader = (header: any, payload: any) => Promise<string | Buffer>;
27+
export type SecretLoader = (header: any, payload: any) => Promise<string | string[] | Buffer | Buffer[]>;
2828

2929
export interface Middleware extends Koa.Middleware {
3030
unless(params?: any): any;

0 commit comments

Comments
 (0)