type
AuthSession
Framework session metadata plus a typed authenticated user.
Properties
| Property | Type | Description |
|---|---|---|
ID | string | ID is the safe, non-secret identifier used for session management. |
Collection | string | Collection is the auth-enabled collection that owns the user identity. |
User | User | User is the current authenticated document. |
ExpiresAt | string | ExpiresAt is the session's RFC 3339 expiry timestamp. |
How it works
ID is a safe management identifier, not a bearer token. Collection disambiguates identities when several auth collections exist.
Full signature
type AuthSession[User any] struct {
// ID is the safe, non-secret identifier used for session management.
ID string `json:"id"`
// Collection is the auth-enabled collection that owns the user identity.
Collection string `json:"collection"`
// User is the current authenticated document.
User User `json:"user"`
// ExpiresAt is the session's RFC 3339 expiry timestamp.
ExpiresAt string `json:"expiresAt"`
}