Fix auth redirects for /dreamgirl subpath

Make login/logout and redirects work when deployed under a subdirectory (e.g. /dreamgirl).

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dsyoon
2026-02-08 12:39:03 +09:00
parent e008000aa6
commit ffcb263131
5 changed files with 22 additions and 8 deletions

View File

@@ -11,7 +11,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if (dreamgirl_check_credentials($username, $password)) {
$_SESSION['dreamgirl_user'] = 'admin';
header('Location: /index.php');
header('Location: ' . dreamgirl_url('index.php'));
exit;
}
@@ -37,7 +37,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
</head>
<body>
<div class="wrap">
<form class="card" method="post" action="/login.php" autocomplete="off">
<form class="card" method="post" action="<?php echo htmlspecialchars(dreamgirl_url('login.php'), ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8'); ?>" autocomplete="off">
<h1>로그인</h1>
<label for="username">아이디</label>
<input id="username" name="username" type="text" required autofocus />