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