Reference · React
useSession()
React hooktechne-sdk/auth/react
The signed-in person's session, or null.
It is null while the session is restored, when nobody is signed in, and under a techne= provider, whose session your app holds itself. The session is what connect takes.
Returns
| Name | Type | What it is |
|---|---|---|
session | OAuthSession | null | The atproto OAuth session. session.did is the person's DID. |
Next to it also in techne-sdk/auth/react
| Name | Type | What it is |
|---|---|---|
useAuthStatus() | 'restoring' | 'signed-in' | 'signed-out' | Where sign-in stands, for a screen that would rather wait. Under a techne= provider it reads the client, and an empty did is signed out. |
useSignOut() | () => Promise<void> | Revokes the session at its PDS. The provider goes back to the anonymous client at once. It rejects under a techne= provider. |
A failed restore is signed out, and the provider's onError hears it. A session the OAuth library deletes, because its refresh failed, goes back to signed out too.
An account corner
Restore and sign out as calls
Set by TechneProvider when it restores the session on mount