Auto-login via NCue session

If already logged in on ncue.net (Google), reuse NCue session and skip DreamGirl admin prompt.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dsyoon
2026-02-08 12:47:53 +09:00
parent ffcb263131
commit 16a856a944
2 changed files with 97 additions and 0 deletions

View File

@@ -4,6 +4,16 @@ require_once __DIR__ . '/auth/auth.php';
dreamgirl_session_start();
$didSso = false;
// If the user is already logged-in to NCue (Google), auto-login to DreamGirl.
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$didSso = dreamgirl_try_ncue_sso_login();
if ($didSso) {
header('Location: ' . dreamgirl_url('index.php'));
exit;
}
}
$error = '';
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$username = isset($_POST['username']) ? (string)$_POST['username'] : '';