haskell-tdlib-2.0.47.0
Safe HaskellSafe-Inferred
LanguageGHC2021

TD.Data.AuthorizationState

Synopsis

Documentation

data AuthorizationState Source #

Represents the current authorization state of the TDLib client

Constructors

AuthorizationStateWaitTdlibParameters

Initialization parameters are needed. Call setTdlibParameters to provide them

AuthorizationStateWaitPhoneNumber

TDLib needs the user's phone number to authorize. Call setAuthenticationPhoneNumber to provide the phone number, or use requestQrCodeAuthentication or checkAuthenticationBotToken for other authentication options

AuthorizationStateWaitEmailAddress

TDLib needs the user's email address to authorize. Call setAuthenticationEmailAddress to provide the email address, or directly call checkAuthenticationEmailCode with Apple ID/Google ID token if allowed

Fields

AuthorizationStateWaitEmailCode

TDLib needs the user's authentication code sent to an email address to authorize. Call checkAuthenticationEmailCode to provide the code

Fields

AuthorizationStateWaitCode

TDLib needs the user's authentication code to authorize. Call checkAuthenticationCode to check the code

Fields

AuthorizationStateWaitOtherDeviceConfirmation

The user needs to confirm authorization on another logged in device by scanning a QR code with the provided link

Fields

  • link :: Maybe Text

    A tg:// URL for the QR code. The link will be updated frequently

AuthorizationStateWaitRegistration

The user is unregistered and need to accept terms of service and enter their first name and last name to finish registration. Call registerUser to accept the terms of service and provide the data

Fields

AuthorizationStateWaitPassword

The user has been authorized, but needs to enter a 2-step verification password to start using the application. Call checkAuthenticationPassword to provide the password, or requestAuthenticationPasswordRecovery to recover the password, or deleteAccount to delete the account after a week

Fields

AuthorizationStateReady

The user has been successfully authorized. TDLib is now ready to answer general requests

AuthorizationStateLoggingOut

The user is currently logging out

AuthorizationStateClosing

TDLib is closing, all subsequent queries will be answered with the error 500. Note that closing TDLib can take a while. All resources will be freed only after authorizationStateClosed has been received

AuthorizationStateClosed

TDLib client is in its final state. All databases are closed and all resources are released. No other updates will be received after this. All queries will be responded to with error code 500. To continue working, one must create a new instance of the TDLib client