diff options
| author | Syndamia <kamen@syndamia.com> | 2025-02-08 17:12:22 +0200 |
|---|---|---|
| committer | Syndamia <kamen@syndamia.com> | 2025-02-08 17:12:22 +0200 |
| commit | c1a7d625fc0c86727a4e4a9dc6cfa1e19699d170 (patch) | |
| tree | 02001659fef0e2b578a6c8644d579344accd5748 /views/user/authenticate.php | |
| parent | 6a3ac35d35e92537438a47eb0441a077a5d791cf (diff) | |
| download | nowayforward_human-c1a7d625fc0c86727a4e4a9dc6cfa1e19699d170.tar nowayforward_human-c1a7d625fc0c86727a4e4a9dc6cfa1e19699d170.tar.gz nowayforward_human-c1a7d625fc0c86727a4e4a9dc6cfa1e19699d170.zip | |
feat(authenticate): Delete requests for expired cookies
Diffstat (limited to 'views/user/authenticate.php')
| -rw-r--r-- | views/user/authenticate.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/views/user/authenticate.php b/views/user/authenticate.php index e4cf47e..ba0dd30 100644 --- a/views/user/authenticate.php +++ b/views/user/authenticate.php @@ -9,6 +9,14 @@ if ($_SERVER['REQUEST_METHOD'] !== 'POST') { } try { + $token = Database\Cookie::fromDBtoken($TOKEN); + if (strtotime($token->Expires) < strtotime('now')) { + $token->delete(); + + http_response_code(410); + header('Content-Type: text/plain'); + exit; + } $user = Database\Cookie::fromDB($TOKEN); http_response_code(200); |
