Link Search Menu Expand Document

Method: update2fa

The params array can contain password (current password), new_password, email (optional) and hint params.

Parameters:

NameType
paramsAn array of parameters

Return type: Bool

Example (now fully async!):

try {
    $MadelineProto->update2fa(['password' => 'current password', 'new_password' => 'New password', 'email' => 'daniil@daniil.it', 'hint' => 'ponies']);
} catch (RPCErrorException $e) {
    if (strpos($e->rpc, 'EMAIL_UNCONFIRMED_') !== false) {
        $Bool = $MadelineProto->account->confirmPasswordEmail(['code' => $MadelineProto->readline('Enter your email code: ')]);
    } else {
        throw $e;
    }
}