Skip to content

Commit

Permalink
Fix #4987
Browse files Browse the repository at this point in the history
  • Loading branch information
z-song committed Sep 25, 2020
1 parent 0d2bac4 commit d576191
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Middleware/Authenticate.php
Expand Up @@ -17,10 +17,12 @@ class Authenticate
*/
public function handle($request, Closure $next)
{
\config(['auth.defaults.guard' => 'admin']);

$redirectTo = admin_base_path(config('admin.auth.redirect_to', 'auth/login'));

if (Admin::guard()->guest() && !$this->shouldPassThrough($request)) {
return redirect()->guest($redirectTo);
return redirect()->to($redirectTo);
}

return $next($request);
Expand Down

0 comments on commit d576191

Please sign in to comment.