Conditions | 2 |
Paths | 2 |
Total Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
18 | public function verify(string $token) |
||
19 | { |
||
20 | $user = app(config('verify-new-email.model'))->whereToken($token)->firstOr(['*'], function () { |
||
21 | throw new InvalidVerificationLinkException( |
||
22 | __('The verification link is not valid anymore.') |
||
23 | ); |
||
24 | })->tap(function ($pendingUserEmail) { |
||
25 | $pendingUserEmail->activate(); |
||
26 | })->user; |
||
27 | |||
28 | if (config('verify-new-email.login_after_verification')) { |
||
29 | return $this->guard()->login($user, config('verify-new-email.login_remember')); |
||
30 | } |
||
31 | |||
32 | return $this->authenticated(); |
||
33 | } |
||
34 | |||
40 |