mirror of
https://gitlab.com/TheGamecraft/c-cms.git
synced 2026-04-21 10:49:10 -04:00
add first login logic
This commit is contained in:
28
app/Http/Middleware/FirstLogin.php
Normal file
28
app/Http/Middleware/FirstLogin.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class FirstLogin
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param Request $request
|
||||
* @param \Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
if ($request->isMethod('get'))
|
||||
{
|
||||
if (\Auth::user()->use_default_psw == true)
|
||||
{
|
||||
return redirect('/admin/setup');
|
||||
}
|
||||
}
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user