GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( e086c7...fa3f58 )
by Pascal
02:56
created

VerifiesPendingEmails::authenticated()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace ProtoneMedia\LaravelVerifyNewEmail\Http;
4
5
use Illuminate\Foundation\Auth\AuthenticatesUsers;
6
7
trait VerifiesPendingEmails
8
{
9
    use AuthenticatesUsers;
10
11
    /**
12
     * Mark the user's new email address as verified.
13
     *
14
     * @param  string $token
15
     *
16
     * @throws \ProtoneMedia\LaravelVerifyNewEmail\Http\InvalidVerificationLinkException
17
     */
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
35
    protected function authenticated()
36
    {
37
        return redirect(config('verify-new-email.redirect_to'))->with('verified', true);
38
    }
39
}
40