@nathapp/nestjs-auth 1.0.0-rc.4 → 1.0.0-rc.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -20,7 +20,10 @@ export interface StrategyProvider {
|
|
|
20
20
|
export declare abstract class JwtStrategyProvider implements StrategyProvider {
|
|
21
21
|
protected readonly jwtOptions: JwtOptions;
|
|
22
22
|
private readonly jwtProvider;
|
|
23
|
-
readonly secretOrPrivateKey: string | Buffer
|
|
23
|
+
readonly secretOrPrivateKey: string | Buffer | {
|
|
24
|
+
key: string | Buffer;
|
|
25
|
+
passphrase: string;
|
|
26
|
+
};
|
|
24
27
|
readonly secretOrPublicKey: string | Buffer;
|
|
25
28
|
readonly jwtFromRequestFunction: JwtFromRequestFunction;
|
|
26
29
|
readonly ignoreExpiration: boolean;
|
|
@@ -41,9 +41,9 @@ class DefaultJwtStrategyProvider extends JwtStrategyProvider {
|
|
|
41
41
|
async validate(req, payload) {
|
|
42
42
|
const { checkBlacklisted, bindIp, allowDuplicateLogin } = this.jwtOptions;
|
|
43
43
|
this.logger.debug(`validating Jwt request`);
|
|
44
|
-
this.logger.
|
|
44
|
+
this.logger.verbose(`payload: ${JSON.stringify(payload)}`);
|
|
45
45
|
const principal = await this.authProvider.getPrincipal(payload);
|
|
46
|
-
this.logger.
|
|
46
|
+
this.logger.verbose(`principal: ${JSON.stringify(principal)}`);
|
|
47
47
|
if (!principal) {
|
|
48
48
|
throw new nestjs_common_1.AppException(nestjs_common_1.CommonExceptionCode.NOT_FOUND);
|
|
49
49
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nathapp/nestjs-auth",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.5",
|
|
4
4
|
"description": "nestjs-auth",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "rimraf dist && tsc -p tsconfig.json",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"lib": "lib"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@nathapp/auth": "^1.0.1-rc.
|
|
35
|
+
"@nathapp/auth": "^1.0.1-rc.2",
|
|
36
36
|
"@nathapp/nestjs-common": "^1.0.1-rc.5",
|
|
37
37
|
"passport-jwt": "^4.0.1"
|
|
38
38
|
},
|