Code Duplication    Length = 7-9 lines in 2 locations

application/modules/socauth/socauth.php 2 locations

@@ 311-319 (lines=9) @@
308
            /** @var $facebookService Facebook */
309
            $facebookService = $this->serviceFactory->createService('facebook', $credentials, $storage);
310
311
            if (!empty($this->input->get('code'))) {
312
313
                $state = $this->input->get('state') ?: null;
314
315
                $token = $facebookService->requestAccessToken($this->input->get('code'), $state);
316
317
                $result = json_decode($facebookService->request('/me?fields=email,name,location'), true);
318
319
            }
320
321
            if (!$this->dx_auth->is_logged_in()) {
322
                $this->socAuth('fb', $result['id'], $result['name'], $result['email'], $result['location']['name'], '', '');
@@ 392-398 (lines=7) @@
389
            );
390
            /** @var $googleService Google */
391
            $googleService = $this->serviceFactory->createService('google', $credentials, $storage, ['userinfo_email', 'userinfo_profile']);
392
            if (!empty($this->input->get('code'))) {
393
                $state = $this->input->get('state') ?: null;
394
                $googleService->requestAccessToken($this->input->get('code'), $state);
395
396
                $result = json_decode($googleService->request('userinfo'), true);
397
398
            }
399
400
            if (!$this->dx_auth->is_logged_in()) {
401
                $this->socAuth('google', $result['id'], $result['name'], $result['email'], '', '', '');