@@ -28,13 +28,13 @@ |
||
28 | 28 | public function updatePassword(string $email, string $password): ?User |
29 | 29 | { |
30 | 30 | if ($user = $this->findOneByEmail($email)) { |
31 | - $user->setPassword($password); |
|
31 | + $user->setPassword($password); |
|
32 | 32 | |
33 | - $this->getEntityManager()->persist($user); |
|
33 | + $this->getEntityManager()->persist($user); |
|
34 | 34 | |
35 | - $this->getEntityManager()->flush(); |
|
35 | + $this->getEntityManager()->flush(); |
|
36 | 36 | |
37 | - return $user; |
|
37 | + return $user; |
|
38 | 38 | } |
39 | 39 | } |
40 | 40 |
@@ -95,10 +95,11 @@ discard block |
||
95 | 95 | ->findOneBy([ |
96 | 96 | 'username' => $ownerDetails->getEmail(), |
97 | 97 | ]); |
98 | - if (!$user) |
|
99 | - |
|
98 | + if (!$user) { |
|
99 | + |
|
100 | 100 | |
101 | 101 | $user = $this->createUser($ownerDetails); |
102 | + } |
|
102 | 103 | |
103 | 104 | |
104 | 105 | |
@@ -122,20 +123,23 @@ discard block |
||
122 | 123 | try { |
123 | 124 | |
124 | 125 | |
125 | - if ($request->get('code')) |
|
126 | - $token = $this->provider->getAccessToken('authorization_code', [ |
|
126 | + if ($request->get('code')) { |
|
127 | + $token = $this->provider->getAccessToken('authorization_code', [ |
|
127 | 128 | 'code' => $request->get('code') |
128 | 129 | ]); |
130 | + } |
|
129 | 131 | |
130 | - if ($request->get('access_token')) |
|
131 | - $token = new AccessToken([ |
|
132 | + if ($request->get('access_token')) { |
|
133 | + $token = new AccessToken([ |
|
132 | 134 | 'access_token' => $request->get('access_token'), |
133 | 135 | ]); |
136 | + } |
|
134 | 137 | |
135 | - if ($request->get('code')) |
|
136 | - $token = $this->provider->getAccessToken('authorization_code', [ |
|
138 | + if ($request->get('code')) { |
|
139 | + $token = $this->provider->getAccessToken('authorization_code', [ |
|
137 | 140 | 'code' => $request->get('code') |
138 | 141 | ]); |
142 | + } |
|
139 | 143 | |
140 | 144 | |
141 | 145 | $data = $this->discoveryUser($token); |
@@ -164,8 +168,9 @@ discard block |
||
164 | 168 | { |
165 | 169 | $peopleEmployee = $user->getPeople()->getPeopleCompany()->first(); |
166 | 170 | |
167 | - if ($peopleEmployee !== false && $peopleEmployee->getCompany() instanceof People) |
|
168 | - return $peopleEmployee->getCompany(); |
|
171 | + if ($peopleEmployee !== false && $peopleEmployee->getCompany() instanceof People) { |
|
172 | + return $peopleEmployee->getCompany(); |
|
173 | + } |
|
169 | 174 | } |
170 | 175 | |
171 | 176 | private function getCompanyId(User $user) |