Conditions | 6 |
Paths | 4 |
Total Lines | 18 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 12.1743 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | 568 | public function handle($request, Closure $next) |
|
21 | { |
||
22 | 568 | if(Auth::check() && !(Route::current()->getName() === 'changePassword' || Route::current()->getName() === 'logout')) |
|
23 | { |
||
24 | // Verify that the users password has not expired |
||
25 | 510 | if(Auth::user()->password_expires !== null) |
|
26 | { |
||
27 | $passExp = new Carbon((Auth::user()->password_expires)); |
||
28 | if(Carbon::now() > $passExp ) |
||
29 | { |
||
30 | Log::notice('User ID-'.Auth::user()->user_id.' is being forced to change their password.'); |
||
31 | $request->session()->flash('change_password', 'change_password'); |
||
32 | return redirect()->route('changePassword'); |
||
33 | } |
||
34 | } |
||
35 | } |
||
36 | |||
37 | 568 | return $next($request); |
|
38 | } |
||
40 |