type

AuthSession

Framework session metadata plus a typed authenticated user.

Properties

PropertyTypeDescription
IDstringID is the safe, non-secret identifier used for session management.
CollectionstringCollection is the auth-enabled collection that owns the user identity.
UserUserUser is the current authenticated document.
ExpiresAtstringExpiresAt 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"` }

Source protocol/envelope.go:435