ユーザーは存在したらも、ログインが失敗したらエラーを発生する
This commit is contained in:
@@ -41,11 +41,15 @@ class User {
|
||||
if (!$res->isSuccess) {
|
||||
$error = $res->message;
|
||||
} else {
|
||||
$auth->setToken($a[0], $a[1]);
|
||||
$result = $auth->setToken($a[0], $a[1]);
|
||||
if (!$result->isSuccess) {
|
||||
$error = $result->message;
|
||||
} else {
|
||||
header('Location: /');
|
||||
exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
$tmpl = new Template('/');
|
||||
$pagetit = 'サインイン';
|
||||
$description = 'サイトにサインイン';
|
||||
|
||||
6
util.php
6
util.php
@@ -113,9 +113,9 @@ function to_money($amount, $lang) {
|
||||
}
|
||||
|
||||
function randstr(): string {
|
||||
srand(floor(time() / (60*60*24)));
|
||||
$len = rand() % 20;
|
||||
return bin2hex(random_bytes($len / 2));
|
||||
srand((int)floor(time() / (60*60*24)));
|
||||
$len = rand(1, 20);
|
||||
return bin2hex(random_bytes($len));
|
||||
}
|
||||
|
||||
function assert_null(mixed $assertion, Throwable|string|null $description = null): bool {
|
||||
|
||||
Reference in New Issue
Block a user