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