Code Duplication    Length = 5-6 lines in 2 locations

app/lib/FFCMS/Controllers/API/API.php 1 location

@@ 319-324 (lines=6) @@
316
        $usersMapper = $usersModel->getMapper();
317
318
        // return if forcing access to https and not https
319
        if ('http' == $f3->get('SCHEME') && !empty($f3->get('api.https'))) {
320
            $this->failure('api_connection_error', "Connection only allowed via HTTPS!", 400);
321
            $this->setOAuthError('unauthorized_client');
322
323
            return false;
324
        }
325
326
        // get token from request to set the user and app
327
        // override if anything in basic auth or client_id/secret AFTER

app/lib/FFCMS/Controllers/API/Token.php 1 location

@@ 227-231 (lines=5) @@
224
     */
225
    protected function password(\Base $f3)
226
    {
227
        if ('http' == $f3->get('SCHEME') && !empty($f3->get('api.https'))) {
228
            $this->failure('api_connection_failure', "Connection only allowed via HTTPS!", 400);
229
            $this->setOAuthError('unauthorized_client');
230
            return;
231
        }
232
233
        // fetch models now
234
        $oAuth2Model = Models\OAuth2::instance();