AuthRepository class

Implementation of an AbstractAuthRepository.

All methods may throw ConnectionException, GraphQlException.

Inheritance
Implemented types

Constructors

AuthRepository(GraphQlProvider _graphQlProvider, MyUserDriftProvider _myUserProvider, CredentialsDriftProvider _credentialsProvider)

Properties

authExceptionHandler Future<void> Function(AuthorizationException)?
Sets handler that will be called on any AuthorizationException.
no getteroverride
hashCode int
The hash code for this object.
no setterinherited
initialized bool
Checks whether the controller has already been initialized.
no setterinherited
isClosed bool
Checks whether the controller has already been closed.
no setterinherited
onDelete InternalFinalCallback<void>
Internal callback that starts the cycle of this controller.
finalinherited
onStart InternalFinalCallback<void>
Called at the exact moment the widget is allocated in memory. It uses an internal "callable" type, to avoid any @overrides in subclases. This method should be internal and is required to define the lifetime cycle of the subclass.
finalinherited
profiles RxList<MyUser>
Returns the known MyUser profiles.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
token AccessTokenSecret?
Sets an authorization token of this repository.
no getteroverride

Methods

$configureLifeCycle() → void
inherited
applyToken() → void
Applies the specified token right away instead of the lazy reconnection.
override
createConfirmationCode({UserLogin? login, UserNum? num, UserEmail? email, UserPhone? phone, String? locale}) Future<void>
Generates and sends a new single-use ConfirmationCode for the MyUser identified by the provided login, num, email and/or phone.
override
deleteSession({SessionId? id, UserPassword? password, DeviceToken? token, AccessTokenSecret? accessToken}) Future<void>
Invalidates a Session with the provided id of the MyUser identified by the accessToken, if any, or otherwise Session of the MyUser identified by the token.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onClose() → void
Called before onDelete method. onClose might be used to dispose resources used by the controller. Like closing events, or streams before the controller is destroyed. Or dispose objects that can potentially create some memory leaks, like TextEditingControllers, AnimationControllers. Might be useful as well to persist some data on disk.
override
onInit() → void
Called immediately after the widget is allocated in memory. You might use this to initialize something for the controller.
override
onReady() → void
Called 1 frame after onInit(). It is the perfect place to enter navigation events, like snackbar, dialogs, or a new route, or async request.
inherited
refreshSession(RefreshTokenSecret secret, {bool reconnect = true}) Future<Credentials>
Refreshes the current AccessToken.
override
removeAccount(UserId id, {bool keepProfile = false}) Future<void>
Deletes the MyUser identified by the provided id from the accounts.
override
signIn({UserLogin? login, UserNum? num, UserEmail? email, UserPhone? phone, UserPassword? password, ConfirmationCode? code}) Future<Credentials>
Creates a new Session for the MyUser identified by the provided num/login/email/phone (exactly one of four should be specified).
override
signUp({UserPassword? password, UserLogin? login}) Future<Credentials>
Creates a new MyUser having only UserId and UserNum fields, and creates a new Session for this MyUser.
override
toString() String
A string representation of this object.
inherited
updateUserPassword({required ConfirmationCode code, required UserPassword newPassword, UserLogin? login, UserNum? num, UserEmail? email, UserPhone? phone}) Future<void>
Resets password for a MyUser identified by the provided num/login/email/phone (exactly one of fourth should be specified) and recovery ConfirmationCode.
override
Uses the specified ChatDirectLink by the authenticated MyUser creating a new Chat-dialog or joining an existing Chat-group.
override
validateConfirmationCode({UserLogin? login, UserNum? num, UserEmail? email, UserPhone? phone, required ConfirmationCode code}) Future<void>
Validates the provided ConfirmationCode for the MyUser identified by the provided login, num, email and/or phone without using it.
override
validateToken(Credentials credentials) Future<void>
Validates the AccessToken of the provided Credentials.
override

Operators

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