fix register email
This commit is contained in:
@ -85,4 +85,15 @@ class UserService
|
||||
return $this->getByField("access_token", $token);
|
||||
}
|
||||
|
||||
public static function createUserByEmailAndPassword(string $email, string $password): void
|
||||
{
|
||||
$user = new User();
|
||||
$user->email = $email;
|
||||
$user->username = $email;
|
||||
$user->password_hash = password_hash($password, PASSWORD_DEFAULT);
|
||||
$user->auth_code = mt_rand(100000, 999999);
|
||||
$user->auth_code_expires_at = date("Y-m-d H:i:s", strtotime("+5 minutes"));
|
||||
$user->save();
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user