@tomei/sso 0.58.8 → 0.58.9
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/package.json
CHANGED
@@ -22,14 +22,11 @@ export class SessionService implements ISessionService {
|
|
22
22
|
async setUserSession(
|
23
23
|
userId: string,
|
24
24
|
sessionData: IUserSession,
|
25
|
+
duration: number = 60 * 60, //1 hour
|
25
26
|
): Promise<void> {
|
26
27
|
try {
|
27
28
|
const key = `${this.environment}tomei-sid:${userId}`;
|
28
|
-
await SessionService._RedisService.set(
|
29
|
-
key,
|
30
|
-
sessionData,
|
31
|
-
60 * 60 * 24 * 1,
|
32
|
-
);
|
29
|
+
await SessionService._RedisService.set(key, sessionData, duration);
|
33
30
|
} catch (error) {
|
34
31
|
throw error;
|
35
32
|
}
|
@@ -49,10 +46,13 @@ export class SessionService implements ISessionService {
|
|
49
46
|
}
|
50
47
|
}
|
51
48
|
|
52
|
-
async refreshDuration(
|
49
|
+
async refreshDuration(
|
50
|
+
userid: string,
|
51
|
+
duration: number = 60 * 60,
|
52
|
+
): Promise<void> {
|
53
53
|
try {
|
54
54
|
const userSession = await this.retrieveUserSession(userid);
|
55
|
-
await this.setUserSession(userid, userSession);
|
55
|
+
await this.setUserSession(userid, userSession, duration);
|
56
56
|
} catch (error) {
|
57
57
|
throw error;
|
58
58
|
}
|