Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changeset/docs-native-session-deadlines.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
8 changes: 6 additions & 2 deletions packages/backend/src/api/resources/Session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,13 @@ export class Session {
readonly status: string,
/** The time the session was last active on the [`Client`](https://clerk.com/docs/reference/backend/types/backend-client). */
readonly lastActiveAt: number,
/** The Unix timestamp when the `Session` will expire. */
/**
* The Unix timestamp when the `Session` will expire. For an [indefinite native session](https://clerk.com/docs/guides/secure/session-options#native-sessions), this is `0`, meaning no expiration deadline. Check `status` to determine whether the session is active.
*/
readonly expireAt: number,
/** The Unix timestamp when the `Session` will be abandoned. */
/**
* The Unix timestamp when the `Session` will be abandoned. For an [indefinite native session](https://clerk.com/docs/guides/secure/session-options#native-sessions), this is `0`, meaning no abandonment deadline.
*/
readonly abandonAt: number,
/** The Unix timestamp when the `Session` was first created. */
readonly createdAt: number,
Expand Down
4 changes: 2 additions & 2 deletions packages/shared/src/types/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,15 +221,15 @@ export interface SessionResource extends ClerkResource {
*/
status: SessionStatus;
/**
* The date and time when the session will expire. Unix epoch zero means no maximum lifetime.
* The date and time when the session will expire. For an [indefinite native session](https://clerk.com/docs/guides/secure/session-options#native-sessions), this represents Unix epoch zero, meaning no expiration deadline is configured.
*/
expireAt: Date;
/**
* Whether the session has a maximum lifetime. `false` when `expireAt` is Unix epoch zero. A session without a maximum lifetime can still end through sign-out or revocation, so use `status` to check whether it is active. `undefined` in ClerkJS versions that predate this property.
*/
readonly hasMaximumLifetime?: boolean;
/**
* The abandonment deadline. Unix epoch zero means no abandonment deadline.
* The abandonment deadline. For an [indefinite native session](https://clerk.com/docs/guides/secure/session-options#native-sessions), this represents Unix epoch zero, meaning no abandonment deadline is configured.
*/
abandonAt: Date;
/**
Expand Down
Loading