Использование базового TOTP через мобильное приложение вместо существующей реализации второго пароля на javascript.
This commit is contained in:
@@ -57,28 +57,5 @@ class Password
|
||||
}
|
||||
return $this->info['pass'];
|
||||
}
|
||||
|
||||
public function changeSecond(?int $passLength): array
|
||||
{
|
||||
if (in_array($passLength, [4, 6, 8])) {
|
||||
$query = 'update users set pass2 = ? where id = ?';
|
||||
$pass2 = PassGen::intCode($passLength);
|
||||
$args = [
|
||||
password_hash($pass2, PASSWORD_DEFAULT),
|
||||
$this->info['id'],
|
||||
];
|
||||
Confirmation::byEmail($this->info, 'pass2', $pass2);
|
||||
$hash = $args[0];
|
||||
} else {
|
||||
$query = 'update users set pass2 = default where id = ?';
|
||||
$args = [$this->info['id']];
|
||||
}
|
||||
|
||||
Db::sql($query, $args);
|
||||
return [
|
||||
'pass2' => $pass2 ?? '',
|
||||
'hash' => $hash ?? null,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user