fixing a few thing
Deploy / deploy (push) Successful in 15s

This commit is contained in:
2026-05-16 12:56:51 +02:00
parent 051efb957f
commit d3d60dcaa9
4 changed files with 64 additions and 30 deletions
+7 -1
View File
@@ -67,6 +67,12 @@ $repo = new Repository($db);
$allowedTokens = $repo->getAllowedUserTokens();
if (empty($allowedTokens)) {
$bootstrapAllowed = filter_var(getenv('ALLOW_FIRST_USER_BOOTSTRAP') ?: 'false', FILTER_VALIDATE_BOOL);
if (!$bootstrapAllowed) {
$_SESSION['auth_error'] = 'No users are authorized for this system. Set allowed_user_tokens or enable first-user bootstrap during initial setup.';
header('Location: ' . $errorRedirect);
exit;
}
$repo->setAllowedUserTokens([$userToken]);
} elseif (!in_array($userToken, $allowedTokens, true)) {
$_SESSION['auth_error'] = 'Your Jakach account is not authorized to access this system. Contact an administrator.';
@@ -86,4 +92,4 @@ unset($_SESSION['auth_error']);
$redirect = isSafeRedirect($rawRedirect) ? $rawRedirect : '/';
header('Location: ' . $redirect);
exit;
exit;