Skip to content

Commit

Permalink
Auth::logout(): invalidate the auth cookie
Browse files Browse the repository at this point in the history
  • Loading branch information
zozlak committed Oct 16, 2024
1 parent 1877042 commit 441e649
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/acdhOeaw/arche/core/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ public function logout(string $redirectUrl = ''): void {
unset($_SERVER['PHP_AUTH_USER'], $_SERVER['HTTP_AUTHORIZATION'], $_SERVER['AUTHORIZATION']);
$this->controller->advertise();

if (!empty($cfg->cookie?->name)) {
setcookie($cfg->cookie->name, '', 1, $cfg->cookie->path ?? '/');

Check failure on line 228 in src/acdhOeaw/arche/core/Auth.php

View workflow job for this annotation

GitHub Actions / phpstan

Undefined variable: $cfg

Check failure on line 228 in src/acdhOeaw/arche/core/Auth.php

View workflow job for this annotation

GitHub Actions / phpstan

Variable $cfg on left side of ?? is never defined.

Check failure on line 228 in src/acdhOeaw/arche/core/Auth.php

View workflow job for this annotation

GitHub Actions / phpstan

Undefined variable: $cfg

Check failure on line 228 in src/acdhOeaw/arche/core/Auth.php

View workflow job for this annotation

GitHub Actions / phpstan

Variable $cfg on left side of ?? is never defined.
}

if (!empty($redirectUrl)) {
header("Refresh: 0; url=$redirectUrl");
}
Expand Down

0 comments on commit 441e649

Please sign in to comment.