diff options
| author | winter | 2025-01-16 20:21:42 +0000 |
|---|---|---|
| committer | winter | 2025-01-16 20:21:42 +0000 |
| commit | b1d6fbc4d740324d96d7fe2677fb15b9b59d20ea (patch) | |
| tree | ae2c996cc6a42b3a42437a7ec8812cd184644817 /routes/user_auth.php | |
| parent | 8de5608976dc8a73a400267601acb4c8e127de5a (diff) | |
follow requests
Diffstat (limited to 'routes/user_auth.php')
| -rw-r--r-- | routes/user_auth.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/routes/user_auth.php b/routes/user_auth.php index afdf8d8..49e138b 100644 --- a/routes/user_auth.php +++ b/routes/user_auth.php @@ -29,4 +29,13 @@ Router::getInstance()->mount('/login', function (array $args) { } else { render_template('login_page', ['email' => $_POST['email'] ?? '', 'failed' => $failedVerification]); } +}); + +Router::getInstance()->mount('/logout', function (array $args) { + if (isset($_COOKIE['digitigrade-session'])) { + $session = Session::findByToken($_COOKIE['digitigrade-session']); + $session->clearCookie(); + $session->remove(); + } + throw new TemporaryRedirect('/'); });
\ No newline at end of file |
