@absolutejs/auth 0.44.3 → 0.45.0
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/dist/index.d.ts +1 -1
- package/dist/index.js +19 -1
- package/dist/index.js.map +4 -4
- package/dist/session/userSessions.d.ts +3 -0
- package/dist/types.d.ts +5 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -15140,7 +15140,7 @@ export * from './session/sessionsConfig';
|
|
|
15140
15140
|
export { endImpersonation, isImpersonating, startImpersonation } from './session/impersonation';
|
|
15141
15141
|
export { createAnonymousSession, isAnonymousSession } from './session/anonymous';
|
|
15142
15142
|
export { addToSessionRing, listRingSessions, readSessionRing, removeFromSessionRing, switchActiveSession } from './session/multiSession';
|
|
15143
|
-
export { listUserSessions, revokeUserSessions } from './session/userSessions';
|
|
15143
|
+
export { listUserSessions, refreshUserSessions, revokeUserSessions } from './session/userSessions';
|
|
15144
15144
|
export type { UserSession } from './session/userSessions';
|
|
15145
15145
|
export { sessionCleanup } from './session/cleanup';
|
|
15146
15146
|
export { createAuthHtmxRoutes } from './htmx/routes';
|
package/dist/index.js
CHANGED
|
@@ -3443,6 +3443,23 @@ var listUserSessions = async ({
|
|
|
3443
3443
|
const records = await Promise.all(ids.map((id) => authSessionStore.getSession(id)));
|
|
3444
3444
|
return ids.map((id, index) => ({ id, session: records[index] })).filter((entry) => entry.session !== undefined && getUserId(entry.session.user) === userId);
|
|
3445
3445
|
};
|
|
3446
|
+
var refreshUserSessions = async ({
|
|
3447
|
+
authSessionStore,
|
|
3448
|
+
getUserId,
|
|
3449
|
+
user,
|
|
3450
|
+
userId
|
|
3451
|
+
}) => {
|
|
3452
|
+
const sessions = await listUserSessions({
|
|
3453
|
+
authSessionStore,
|
|
3454
|
+
getUserId,
|
|
3455
|
+
userId
|
|
3456
|
+
});
|
|
3457
|
+
await Promise.all(sessions.map((entry) => authSessionStore.setSession(entry.id, {
|
|
3458
|
+
...entry.session,
|
|
3459
|
+
user
|
|
3460
|
+
})));
|
|
3461
|
+
return sessions.length;
|
|
3462
|
+
};
|
|
3446
3463
|
var revokeUserSessions = async ({
|
|
3447
3464
|
authSessionStore,
|
|
3448
3465
|
exceptSessionId,
|
|
@@ -25851,6 +25868,7 @@ export {
|
|
|
25851
25868
|
rehashCredentialPassword,
|
|
25852
25869
|
registerClient,
|
|
25853
25870
|
refreshableProviderOptions,
|
|
25871
|
+
refreshUserSessions,
|
|
25854
25872
|
recordLoginAttempt,
|
|
25855
25873
|
readUserInfoBearer,
|
|
25856
25874
|
readSessionRing,
|
|
@@ -26190,5 +26208,5 @@ export {
|
|
|
26190
26208
|
AuthIdentityConflictError
|
|
26191
26209
|
};
|
|
26192
26210
|
|
|
26193
|
-
//# debugId=
|
|
26211
|
+
//# debugId=11387670FAEA3B5D64756E2164756E21
|
|
26194
26212
|
//# sourceMappingURL=index.js.map
|