Conditions | 5 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 1 |
CRAP Score | 19.4658 |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
27 | public function handle(Request $request, Closure $next) |
||
28 | { |
||
29 | // Check to see if we are logged in |
||
30 | if($request->user() && !in_array(Route::current()->getName(), $this->bypassRoutes)) |
||
31 | { |
||
32 | // check to see if the password is expired |
||
33 | if($request->user()->password_expires && $request->user()->password_expires < Carbon::now()) |
||
34 | { |
||
35 | Log::stack(['auth', 'user'])->notice('User '.$request->user()->full_name.' is being forced to change their password'); |
||
36 | return redirect()->route('password.index')->with(['message' => 'Your Password Has Expired. You must change your password to continue', 'type' => 'warning']); |
||
37 | 700 | } |
|
38 | } |
||
39 | |||
40 | return $next($request); |
||
41 | } |
||
43 |