Skip to content

Commit

Permalink
[5.x] Introduce invalid_token variable for password protected page (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
aerni authored Oct 16, 2024
1 parent 00f1472 commit d6c6395
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Auth/Protect/Tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,18 @@ class Tags extends BaseTags

public function passwordForm()
{
if (! $token = Html::entities(request('token'))) {
if (! session('statamic:protect:password.tokens.'.request('token'))) {
$data = [
'errors' => [],
'no_token' => true,
'invalid_token' => true,
];

return $this->parser ? $this->parse($data) : $data;
}

$token = Html::entities(request('token'));

$errors = session('errors', new ViewErrorBag)->passwordProtect;

$data = [
Expand Down

0 comments on commit d6c6395

Please sign in to comment.