@konplit-services/common 1.0.32 → 1.0.33
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.
- package/build/services/Jwt.d.ts +3 -1
- package/build/services/Jwt.js +2 -3
- package/package.json +1 -1
package/build/services/Jwt.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SignOptions } from "jsonwebtoken";
|
|
1
2
|
export declare enum JWTType {
|
|
2
3
|
REFRESH = "REFRESH",
|
|
3
4
|
ACCESS = "ACCESS"
|
|
@@ -8,10 +9,11 @@ export interface JWT_Data {
|
|
|
8
9
|
role: string;
|
|
9
10
|
type: JWTType;
|
|
10
11
|
accountId?: string;
|
|
12
|
+
adminId?: string;
|
|
11
13
|
iat?: string;
|
|
12
14
|
exp?: number;
|
|
13
15
|
}
|
|
14
16
|
export declare class JWT {
|
|
15
|
-
static getToken(data: JWT_Data): Promise<string>;
|
|
17
|
+
static getToken(data: JWT_Data, options?: SignOptions): Promise<string>;
|
|
16
18
|
static verifyToken(token: string): Promise<JWT_Data>;
|
|
17
19
|
}
|
package/build/services/Jwt.js
CHANGED
|
@@ -23,10 +23,9 @@ var JWTType;
|
|
|
23
23
|
})(JWTType = exports.JWTType || (exports.JWTType = {}));
|
|
24
24
|
const secret = process.env.JWT_KEY;
|
|
25
25
|
class JWT {
|
|
26
|
-
static getToken(data) {
|
|
26
|
+
static getToken(data, options = {}) {
|
|
27
27
|
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
|
|
29
|
-
return token;
|
|
28
|
+
return signAsync(data, secret, options);
|
|
30
29
|
});
|
|
31
30
|
}
|
|
32
31
|
static verifyToken(token) {
|