166 lines
2.4 KiB
Markdown
166 lines
2.4 KiB
Markdown
---
|
|
title: danog\MadelineProto\Wrappers\Login: Manages logging in and out.
|
|
description:
|
|
|
|
---
|
|
# `danog\MadelineProto\Wrappers\Login`
|
|
[Back to index](../../../index.md)
|
|
|
|
> Author: Daniil Gentili <daniil@daniil.it>
|
|
|
|
|
|
Manages logging in and out.
|
|
|
|
|
|
|
|
|
|
## Method list:
|
|
* `logout(): \Generator`
|
|
* `botLogin(string $token): \Generator`
|
|
* `phoneLogin(string $number, int $sms_type): \Generator`
|
|
* `completePhoneLogin(string $code): \Generator`
|
|
* `importAuthorization(mixed $authorization): \Generator`
|
|
* `exportAuthorization(): \Generator`
|
|
* `completeSignup(string $first_name, string $last_name): \Generator`
|
|
* `complete2faLogin(string $password): \Generator`
|
|
* `update2fa(array $params): \Generator`
|
|
|
|
## Methods:
|
|
### `logout(): \Generator`
|
|
|
|
Log out currently logged in user.
|
|
|
|
|
|
#### See also:
|
|
* `\Generator`
|
|
|
|
|
|
|
|
|
|
### `botLogin(string $token): \Generator`
|
|
|
|
Login as bot.
|
|
|
|
|
|
Parameters:
|
|
* `$token`: `string` Bot token
|
|
|
|
|
|
#### See also:
|
|
* `\Generator`
|
|
|
|
|
|
|
|
|
|
### `phoneLogin(string $number, int $sms_type): \Generator`
|
|
|
|
Login as user.
|
|
|
|
|
|
Parameters:
|
|
* `$number`: `string` Phone number
|
|
* `$sms_type`: `int` SMS type
|
|
|
|
|
|
#### See also:
|
|
* `\Generator`
|
|
|
|
|
|
|
|
|
|
### `completePhoneLogin(string $code): \Generator`
|
|
|
|
Complet user login using login code.
|
|
|
|
|
|
Parameters:
|
|
* `$code`: `string` Login code
|
|
|
|
|
|
#### See also:
|
|
* `\Generator`
|
|
|
|
|
|
|
|
|
|
### `importAuthorization(mixed $authorization): \Generator`
|
|
|
|
Import authorization.
|
|
|
|
|
|
Parameters:
|
|
* `$authorization`: `mixed` Authorization info
|
|
|
|
|
|
#### See also:
|
|
* `\Generator`
|
|
|
|
|
|
|
|
|
|
### `exportAuthorization(): \Generator`
|
|
|
|
Export authorization.
|
|
|
|
|
|
Fully typed return value:
|
|
```
|
|
\Generator<mixed, array|bool, mixed, array{0: int|string, 1: string}>
|
|
```
|
|
#### See also:
|
|
* `\Generator`
|
|
|
|
|
|
|
|
|
|
### `completeSignup(string $first_name, string $last_name): \Generator`
|
|
|
|
Complete signup to Telegram.
|
|
|
|
|
|
Parameters:
|
|
* `$first_name`: `string` First name
|
|
* `$last_name`: `string` Last name
|
|
|
|
|
|
#### See also:
|
|
* `\Generator`
|
|
|
|
|
|
|
|
|
|
### `complete2faLogin(string $password): \Generator`
|
|
|
|
Complete 2FA login.
|
|
|
|
|
|
Parameters:
|
|
* `$password`: `string` Password
|
|
|
|
|
|
#### See also:
|
|
* `\Generator`
|
|
|
|
|
|
|
|
|
|
### `update2fa(array $params): \Generator`
|
|
|
|
Update the 2FA password.
|
|
The params array can contain password, new_password, email and hint params.
|
|
|
|
Parameters:
|
|
* `$params`: `array` The params
|
|
|
|
|
|
#### See also:
|
|
* `\Generator`
|
|
|
|
|
|
|
|
|
|
## Properties
|
|
* `$settings`: `\Settings` Settings
|
|
---
|
|
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
|