User sessions
When loading your application, you might want to check if the user already has a session.
To do so, you can use the getUserSession
API
getUserSession(): Promise<User | null>
#
Returns null if no session exists, or a User
if they are logged in.
note
This API also works for anonymous users
Example