From 2e726ac42343e58707baeb915dec153ef2839658 Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Fri, 31 May 2024 19:10:47 -0400 Subject: add logout, better router --- src/web/helpers/auth.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/web/helpers/auth.php') diff --git a/src/web/helpers/auth.php b/src/web/helpers/auth.php index 187f556..4d7f184 100644 --- a/src/web/helpers/auth.php +++ b/src/web/helpers/auth.php @@ -34,6 +34,11 @@ class AuthHelper { file_put_contents($path, $data, LOCK_EX); } + public function delete_session(Session $session): int { + $path = "/tmp/{$session->token}"; + return unlink($path) ? 0 : 1; + } + /** * Loads the auth session associated with a specific key * @param string $token - the session $key -- cgit v1.2.3-freya