From 3354d45762bbe0db33e3d26d8997e6f6624f24d7 Mon Sep 17 00:00:00 2001 From: winter Sparkles Date: Sun, 9 Aug 2026 02:26:33 +0100 Subject: implement sessions and also log in/out session data is stored in sqlite, not using php sessions --- routes/index.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'routes/index.php') diff --git a/routes/index.php b/routes/index.php index 685ab92..f884be5 100644 --- a/routes/index.php +++ b/routes/index.php @@ -1,8 +1,20 @@ doc->addChild('content'); $content->addChild('p', 'Welcome to Pleasant SSO!'); + $identity = $session->getIdentity(); + $content->addChild('pre', 'Your identity: ' . print_r($identity, true)); + if ($identity === null) { + $link = $content->addChild('a', L('login.title')); + $link->addAttribute('href', '/login'); + } else { + $link = $content->addChild('a', L('logout.title')); + $link->addAttribute('href', '/logout'); + } $resp->send(); } -- cgit v1.3