Code Duplication    Length = 5-6 lines in 2 locations

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

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

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

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