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:
@@ -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 />
|
||||
|
||||
Reference in New Issue
Block a user