1 <?php namespace BookStack\Http\Middleware;
4 use Illuminate\Contracts\Auth\Guard;
6 class RedirectIfAuthenticated
9 * The Guard implementation.
16 * Create a new filter instance.
21 public function __construct(Guard $auth)
27 * Handle an incoming request.
29 * @param \Illuminate\Http\Request $request
30 * @param \Closure $next
33 public function handle($request, Closure $next)
35 $requireConfirmation = setting('registration-confirmation');
36 if ($this->auth->check() && (!$requireConfirmation || ($requireConfirmation && $this->auth->user()->email_confirmed))) {
40 return $next($request);