mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-07 22:38:13 +08:00
correct previous mistakes due to bad docs
This commit is contained in:
@@ -38,7 +38,8 @@ server.register({
|
||||
};
|
||||
},
|
||||
verifyOptions: {
|
||||
algorithms: ['HS256']
|
||||
algorithms: ['HS256'],
|
||||
issuer: 'test',
|
||||
}
|
||||
};
|
||||
server.auth.strategy('jwt', 'jwt', opts);
|
||||
|
||||
23
types/hapi-auth-jwt2/index.d.ts
vendored
23
types/hapi-auth-jwt2/index.d.ts
vendored
@@ -6,6 +6,7 @@
|
||||
// TypeScript Version: 2.4
|
||||
|
||||
import { Request, ResponseObject, Plugin, ResponseToolkit } from 'hapi';
|
||||
import { VerifyOptions } from 'jsonwebtoken';
|
||||
|
||||
declare module 'hapi' {
|
||||
interface ServerAuth {
|
||||
@@ -62,27 +63,7 @@ declare namespace hapiAuthJwt2 {
|
||||
/**
|
||||
* Settings to define how tokens are verified by the jsonwebtoken library
|
||||
*/
|
||||
verifyOptions?: {
|
||||
/**
|
||||
* Ignore expired tokens
|
||||
*/
|
||||
ignoreExpiration?: boolean;
|
||||
|
||||
/**
|
||||
* Do not enforce token audience
|
||||
*/
|
||||
audience?: boolean;
|
||||
|
||||
/**
|
||||
* Do not require the issuer to be valid
|
||||
*/
|
||||
issuer?: boolean;
|
||||
|
||||
/**
|
||||
* List of allowed algorithms
|
||||
*/
|
||||
algorithms?: string[];
|
||||
};
|
||||
verifyOptions?: VerifyOptions;
|
||||
|
||||
/**
|
||||
* function called to decorate the response with authentication headers
|
||||
|
||||
Reference in New Issue
Block a user