Class SupabaseAuth
Email and password auth against Supabase GoTrue.
The session is saved in Preferences and restored on the next launch,
so a user stays signed in until signOut().
-
Method Summary
Modifier and TypeMethodDescriptionThe current session, restored fromPreferenceson first use.booleanTrue when a session exists.refresh()Exchanges the refresh token for a new session.voidReplaces the session and saves it.Signs in with email and password.signOut()Signs out on the server and forgets the session locally.Creates a user.
-
Method Details
-
getSession
The current session, restored from
Preferenceson first use.Returns
the session, or null when nobody is signed in
-
setSession
Replaces the session and saves it. Pass null to forget it.
Parameters
s: the session, or null
-
isSignedIn
public boolean isSignedIn()True when a session exists.
Returns
whether a user is signed in
-
signUp
Creates a user. When the project requires email confirmation the result completes with null, since there is no session yet.
Parameters
-
email: the email -
password: the password
Returns
the new session, or null pending confirmation
-
-
signIn
Signs in with email and password.
Parameters
-
email: the email -
password: the password
Returns
the session
-
-
refresh
Exchanges the refresh token for a new session. Concurrent calls share one request.
Returns
the new session; fails when there is no refresh token
-
signOut
Signs out on the server and forgets the session locally.
Returns
completes with true once the local session is cleared
-