docta-package 1.2.69 → 1.2.75
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.
|
@@ -32,5 +32,6 @@ export declare enum EnumStatusCode {
|
|
|
32
32
|
PERIOD_OCCUPIED = "PERIOD_OCCUPIED",
|
|
33
33
|
PATIENT_NOT_FOUND = "PATIENT_NOT_FOUND",
|
|
34
34
|
PERIOD_NOT_FOUND = "PERIOD_NOT_FOUND",
|
|
35
|
-
PERIOD_PASSED = "PERIOD_PASSED"
|
|
35
|
+
PERIOD_PASSED = "PERIOD_PASSED",
|
|
36
|
+
PERIOD_TOO_CLOSE_TO_START = "PERIOD_TOO_CLOSE_TO_START"
|
|
36
37
|
}
|
|
@@ -37,4 +37,5 @@ var EnumStatusCode;
|
|
|
37
37
|
EnumStatusCode["PATIENT_NOT_FOUND"] = "PATIENT_NOT_FOUND";
|
|
38
38
|
EnumStatusCode["PERIOD_NOT_FOUND"] = "PERIOD_NOT_FOUND";
|
|
39
39
|
EnumStatusCode["PERIOD_PASSED"] = "PERIOD_PASSED";
|
|
40
|
+
EnumStatusCode["PERIOD_TOO_CLOSE_TO_START"] = "PERIOD_TOO_CLOSE_TO_START";
|
|
40
41
|
})(EnumStatusCode || (exports.EnumStatusCode = EnumStatusCode = {}));
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { LoggedInUserTokenData } from "../interfaces";
|
|
2
2
|
export declare class TokenUtils {
|
|
3
3
|
static createActivationToken(userId: string): string;
|
|
4
|
-
static
|
|
4
|
+
static verifyActivationToken(token: string): string | null;
|
|
5
5
|
static createAccessToken(payload: LoggedInUserTokenData): string;
|
|
6
6
|
static createRefreshToken(payload: LoggedInUserTokenData): string;
|
|
7
7
|
static verifyRefreshToken(token: string): LoggedInUserTokenData | null;
|
|
8
8
|
static verifyAccessToken(token: string): LoggedInUserTokenData;
|
|
9
9
|
static createForgotPasswordToken(userId: string): string;
|
|
10
|
-
static
|
|
10
|
+
static verifyForgotPasswordToken(token: string): string | null;
|
|
11
11
|
}
|
|
@@ -8,9 +8,9 @@ const jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
|
|
|
8
8
|
const config_1 = require("../config");
|
|
9
9
|
class TokenUtils {
|
|
10
10
|
static createActivationToken(userId) {
|
|
11
|
-
return jsonwebtoken_1.default.sign({ userId }, (0, config_1.getGeneralConfig)().
|
|
11
|
+
return jsonwebtoken_1.default.sign({ userId }, (0, config_1.getGeneralConfig)().activationTokenSecret);
|
|
12
12
|
}
|
|
13
|
-
static
|
|
13
|
+
static verifyActivationToken(token) {
|
|
14
14
|
try {
|
|
15
15
|
const decoded = jsonwebtoken_1.default.verify(token, (0, config_1.getGeneralConfig)().activationTokenSecret);
|
|
16
16
|
if (typeof decoded === "string") {
|
|
@@ -63,7 +63,7 @@ class TokenUtils {
|
|
|
63
63
|
static createForgotPasswordToken(userId) {
|
|
64
64
|
return jsonwebtoken_1.default.sign({ userId }, (0, config_1.getGeneralConfig)().forgotPasswordTokenSecret);
|
|
65
65
|
}
|
|
66
|
-
static
|
|
66
|
+
static verifyForgotPasswordToken(token) {
|
|
67
67
|
try {
|
|
68
68
|
const decoded = jsonwebtoken_1.default.verify(token, (0, config_1.getGeneralConfig)().forgotPasswordTokenSecret);
|
|
69
69
|
if (typeof decoded === "string") {
|