AnonymousAuthController class

Controller for managing anonymous-based authentication flows.

Inheritance

Constructors

AnonymousAuthController({required ServerpodClientShared client, Future<String?> createAnonymousToken()?, VoidCallback? onAuthenticated, dynamic onError(Object error)?})
Creates a new AnonymousAuthController instance.

Properties

client → ServerpodClientShared
The Serverpod client instance.
final
createAnonymousToken → Future<String?> Function()?
Function to generate the anonymous token supplied to the login endpoint. This token can fill many roles, including app attestation if the onBeforeAnonymousAccountCreated callback is used to prevent abuse. If onBeforeAnonymousAccountCreated is not configured on the server, then this function and any token it would generate are likely meaningless.
final
hashCode → int
The hash code for this object.
no setterinherited
hasListeners → bool
Whether any listeners are currently registered.
no setterinherited
isLoading → bool
Whether the controller is currently processing a request.
no setter
onAuthenticated → VoidCallback?
Callback when authentication is successful.
final
onError → dynamic Function(Object error)?
Callback when an error occurs during authentication.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
state → AnonymousAuthState
The current state of the authentication flow.
no setter

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
dispose() → void
Discards any resources used by the object.
inherited
login() → Future<void>
Initiates the anonymous sign-in process.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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