Skip to content

Commit

Permalink
Add GuardHelpers::alreadyAuthenticated()
Browse files Browse the repository at this point in the history
It behave similarly to `GuardHelpers::check()`, but it doesn't trigger any side effects.
  • Loading branch information
mpyw committed Jun 8, 2018
1 parent 2ef91b4 commit c284bcb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Illuminate/Auth/GuardHelpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ public function authenticate()
throw new AuthenticationException;
}

/**
* Determine if the current user is already authenticated without triggering side effects.
*
* @return bool
*/
public function alreadyAuthenticated()
{
return ! is_null($this->user);
}

/**
* Determine if the current user is authenticated.
*
Expand Down

0 comments on commit c284bcb

Please sign in to comment.