mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2025-03-29 06:17:46 +01:00
#29: This works because the only disabled accounts right now are merged ones.
This commit is contained in:
parent
a9bc69ec02
commit
3b1fa792cf
1 changed files with 5 additions and 1 deletions
|
@ -53,11 +53,15 @@ class DisabledAccountCheck
|
||||||
*/
|
*/
|
||||||
public function handle($request, Closure $next)
|
public function handle($request, Closure $next)
|
||||||
{
|
{
|
||||||
|
// TODO: don't automatically log the user out some time after
|
||||||
|
// issue #29 is fixed or when disabled_at starts being used for
|
||||||
|
// something other than merged accounts.
|
||||||
if ($this->auth->check()
|
if ($this->auth->check()
|
||||||
&& $this->auth->user()->disabled_at !== null
|
&& $this->auth->user()->disabled_at !== null
|
||||||
&& !($request->getMethod() === 'POST' && $request->getRequestUri() == '/auth/logout')
|
&& !($request->getMethod() === 'POST' && $request->getRequestUri() == '/auth/logout')
|
||||||
){
|
){
|
||||||
return Response::view('home.account-disabled', ['username' => $this->auth->user()->username], 403);
|
$this->auth->logout();
|
||||||
|
// return Response::view('home.account-disabled', ['username' => $this->auth->user()->username], 403);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $next($request);
|
return $next($request);
|
||||||
|
|
Loading…
Add table
Reference in a new issue