Auto-submit four digit launcher PIN

This commit is contained in:
seo
2026-06-17 19:52:11 +09:00
parent 5275aa17c2
commit db48512585
3 changed files with 64 additions and 38 deletions
+1 -5
View File
@@ -10,7 +10,7 @@ $config = custom_config();
function launcher_is_digit_password(string $password): bool
{
return $password !== '' && ctype_digit($password);
return preg_match('/^\d{4}$/', $password) === 1;
}
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
@@ -48,10 +48,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
custom_json(['result' => 'fail', 'message' => 'current_password_invalid'], 401);
}
if (mb_strlen($next) < 4) {
custom_json(['result' => 'fail', 'message' => 'password_too_short'], 422);
}
if (!custom_save_password_hash(password_hash($next, PASSWORD_DEFAULT))) {
custom_json(['result' => 'fail', 'message' => 'password_save_failed'], 500);
}