@absolutejs/auth 0.44.2 → 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.
@@ -10,6 +10,9 @@ type ListUserSessionsProps<UserType> = {
10
10
  userId: string;
11
11
  };
12
12
  export declare const listUserSessions: <UserType>({ authSessionStore, getUserId, userId }: ListUserSessionsProps<UserType>) => Promise<UserSession<UserType>[]>;
13
+ export declare const refreshUserSessions: <UserType>({ authSessionStore, getUserId, user, userId }: ListUserSessionsProps<UserType> & {
14
+ user: UserType;
15
+ }) => Promise<number>;
13
16
  export declare const revokeUserSessions: <UserType>({ authSessionStore, exceptSessionId, getUserId, userId }: ListUserSessionsProps<UserType> & {
14
17
  exceptSessionId?: UserSessionId;
15
18
  }) => Promise<number>;
package/dist/types.d.ts CHANGED
@@ -48,6 +48,11 @@ export type Impersonator = {
48
48
  startedAt: number;
49
49
  };
50
50
  export type SessionData<UserType> = {
51
+ /** Snapshot of your user, serialized into the session at login and handed to
52
+ * `protectRoute`/`userStatus` as-is — it is NOT re-read from your user table per
53
+ * request. Mutations made after login (role grants, bans, tier changes) stay
54
+ * invisible to existing sessions until you rewrite the snapshot with
55
+ * `refreshUserSessions`. */
51
56
  user: UserType;
52
57
  /** OAuth provider access token. Optional: credential / SSO sessions are not backed
53
58
  * by a provider token, so they omit it. Only the OAuth routes (profile, refresh,
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.44.2",
2
+ "version": "0.45.0",
3
3
  "name": "@absolutejs/auth",
4
4
  "description": "An authorization library for absolutejs",
5
5
  "repository": {