Documentation - v0.27.1
    Preparing search index...
    • Execute the QR login flow.

      This method will resolve once the authorization is complete, returning the authorized user.

      Parameters

      • client: ITelegramClient
      • params: {
            abortSignal?: AbortSignal;
            invalidPasswordCallback?: () => MaybePromise<void>;
            onQrScanned?: () => void;
            onUrlUpdated: (url: string, expires: Date) => void;
            password?: MaybeDynamic<string>;
        }
        • OptionalabortSignal?: AbortSignal

          Abort signal

        • OptionalinvalidPasswordCallback?: () => MaybePromise<void>

          Function that will be called after the server has rejected the password.

          Note that in case password is not a function, this callback will never be called, and an error will be thrown instead.

        • OptionalonQrScanned?: () => void

          Function that will be called when the user has scanned the QR code (i.e. when updateLoginToken is received), and the library is finalizing the auth

        • onUrlUpdated: (url: string, expires: Date) => void

          Function that will be called whenever the login URL is changed.

          The app is expected to display url as a QR code to the user

        • Optionalpassword?: MaybeDynamic<string>

          Password for 2FA

      Returns Promise<User>