mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-12-29 10:21:25 -06:00
Middleware does not fire when user is not logged in.
This commit is contained in:
parent
707af8bb4e
commit
4b869f0d9e
@ -45,12 +45,9 @@ class IsDemoUser
|
||||
public function handle(Request $request, Closure $next, $guard = null)
|
||||
{
|
||||
if (Auth::guard($guard)->guest()) {
|
||||
if ($request->ajax()) {
|
||||
return response('Unauthorized.', 401);
|
||||
}
|
||||
|
||||
return redirect()->guest('login');
|
||||
}
|
||||
// don't care when not logged in, usual stuff applies:
|
||||
return $next($request);
|
||||
}
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
if ($user->hasRole('demo')) {
|
||||
|
@ -45,11 +45,8 @@ class IsSandStormUser
|
||||
public function handle(Request $request, Closure $next, $guard = null)
|
||||
{
|
||||
if (Auth::guard($guard)->guest()) {
|
||||
if ($request->ajax()) {
|
||||
return response('Unauthorized.', 401);
|
||||
}
|
||||
|
||||
return redirect()->guest('login');
|
||||
// don't care when not logged in, usual stuff applies:
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
if (1 === intval(getenv('SANDSTORM'))) {
|
||||
|
Loading…
Reference in New Issue
Block a user