$authStore
The $authStore
store provides a convenient way to access the current auth state and helper methods for managing the active session.
$authStore.get()
returns
- Name
userId
- Type
string
- Description
The ID of the current user.
- Name
sessionId
- Type
string
- Description
The ID of the current session.
- Name
orgId
- Type
string
- Description
The ID of the user's active organization.
- Name
orgRole
- Type
string
- Description
The current user's role in their active organization.
- Name
orgSlug
- Type
string
- Description
The URL-friendly identifier of the user's active organization.
How to use the $authStore
store
The following example demonstrates how to use the $authStore
store to access the current auth state. It uses userId
to detect if the user is signed in.
Feedback
Last updated on