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.

Code Duplication    Length = 17-19 lines in 2 locations

src/Api/UsersModule.php 1 location

@@ 60-76 (lines=17) @@
57
58
        $service->post(
59
            '/set_totp_secret',
60
            function (Request $request, array $hookData) {
61
                AuthUtils::requireUser($hookData, ['vpn-user-portal']);
62
63
                $userId = InputValidation::userId($request->getPostParameter('user_id'));
64
                $totpKey = InputValidation::totpKey($request->getPostParameter('totp_key'));
65
                $totpSecret = InputValidation::totpSecret($request->getPostParameter('totp_secret'));
66
67
                $twoFactor = new TwoFactor($this->storage, new DateTime('now'));
68
                try {
69
                    $twoFactor->verifyTotp($userId, $totpKey, $totpSecret);
70
                } catch (TwoFactorException $e) {
71
                    return new ApiErrorResponse('set_totp_secret', $e->getMessage());
72
                }
73
                $this->storage->setTotpSecret($userId, $totpSecret);
74
75
                return new ApiResponse('set_totp_secret');
76
            }
77
        );
78
79
        $service->post(

src/Api/ConnectionsModule.php 1 location

@@ 121-139 (lines=19) @@
118
        return new ApiResponse('disconnect');
119
    }
120
121
    public function verifyOtp(Request $request)
122
    {
123
        $commonName = InputValidation::commonName($request->getPostParameter('common_name'));
124
        // we do not need 'otp_type', as only 'totp' is supported at the moment
125
        InputValidation::otpType($request->getPostParameter('otp_type'));
126
        $totpKey = InputValidation::totpKey($request->getPostParameter('totp_key'));
127
128
        $certInfo = $this->storage->getUserCertificateInfo($commonName);
129
        $userId = $certInfo['user_id'];
130
131
        $twoFactor = new TwoFactor($this->storage, new DateTime('now'));
132
        try {
133
            $twoFactor->verifyTotp($userId, $totpKey);
134
        } catch (TwoFactorException $e) {
135
            return new ApiErrorResponse('verify_otp', $e->getMessage());
136
        }
137
138
        return new ApiResponse('verify_otp');
139
    }
140
141
    private function verifyConnection($profileId, $commonName)
142
    {