Skip to content

Commit

Permalink
[6.x] Add "unauthenticated" method in auth middleware (#30177)
Browse files Browse the repository at this point in the history
* Separate "unauthenticated" method in auth middleware

* Update Authenticate.php

* Update Authenticate.php
  • Loading branch information
TitasGailius authored and taylorotwell committed Oct 4, 2019
1 parent 9a81e30 commit 2095b02
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Illuminate/Auth/Middleware/Authenticate.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,20 @@ protected function authenticate($request, array $guards)
}
}

$this->unauthenticated($request, $guards);
}

/**
* Handle an unauthenticated user.
*
* @param \Illuminate\Http\Request $request
* @param array $guards
* @return void
*
* @throws \Illuminate\Auth\AuthenticationException
*/
protected function unauthenticated($request, array $guards)
{
throw new AuthenticationException(
'Unauthenticated.', $guards, $this->redirectTo($request)
);
Expand Down

0 comments on commit 2095b02

Please sign in to comment.