Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.
public class SupabaseAuth
- Object
- 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().
Methods
Inherited methods
Method details
getSession
public SupabaseSession getSession()The current session, restored from
Preferences on first use.Returns
the session, or null when nobody is signed in
setSession
public void setSession(SupabaseSession s)Replaces the session and saves it. Pass null to forget it.
Parameters
sSupabaseSession- the session, or null
isSignedIn
public boolean isSignedIn()True when a session exists.
Returns
whether a user is signed in
signUp
public AsyncResource<SupabaseSession> signUp(String email, String password)Creates a user. When the project requires email confirmation the
result completes with null, since there is no session yet.
Parameters
emailString- the email
passwordString- the password
Returns
the new session, or null pending confirmation
signIn
public AsyncResource<SupabaseSession> signIn(String email, String password)Signs in with email and password.
Parameters
emailString- the email
passwordString- the password
Returns
the session
refresh
public AsyncResource<SupabaseSession> 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
public AsyncResource<Boolean> signOut()Signs out on the server and forgets the session locally.
Returns
completes with true once the local session is cleared