SupaAuthManager class

Class for handling Supabase Authorization

apiKey and apiSecret are required to use this class prefs is needed for storing login informat loginStateNotifier is needed for notifying users of login state changes

Constructors

SupaAuthManager({required SupabaseClient client, required SharedPreferences prefs, required String apiKey, required String apiSecret, required LoginStateNotifier? loginStateNotifier})

Properties

apiKey String
final
apiSecret String
final
client ↔ SupabaseClient
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
loginStateNotifier LoginStateNotifier?
final
prefs → SharedPreferences
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createUser(String email, String password) Future<Result<bool>>
Create a new user
getPersistSessionString(Session session) String
getUser() DatabaseUser?
Get the stored user information
getUserEmail() String?
Get the stored user email
getUserFromAuth() DatabaseUser?
Get the current logged in user
getUserPassword() String?
Get the stored user password
isLoggedIn() bool
Are we logged in?
loadUser() Future<DatabaseUser?>
When an app starts, call this to load any already logged in user
login(String email, String password) Future<Result<DatabaseUser>>
Login an existing user
logout() → void
Logout the current user
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
refreshSession() Future<bool>
Refresh the current session
resetPassword(String email) → void
Reset the password for the given email TODO: Not sure if this is working correctly email email to reset
toString() String
A string representation of this object.
inherited
updateUserPassword(String email, String password) Future<User?>
Update user's password TODO: Not sure if this is working correctly

Operators

operator ==(Object other) bool
The equality operator.
inherited