@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | */ |
125 | 125 | private function isValidToken($stateToken) { |
126 | 126 | $currentToken = $this->session->get(self::stateName); |
127 | - if(!is_string($stateToken) || !is_string($currentToken)) { |
|
127 | + if (!is_string($stateToken) || !is_string($currentToken)) { |
|
128 | 128 | return false; |
129 | 129 | } |
130 | 130 | return hash_equals($currentToken, $stateToken); |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | public function showAuthPickerPage($clientIdentifier = '') { |
159 | 159 | $clientName = $this->getClientName(); |
160 | 160 | $client = null; |
161 | - if($clientIdentifier !== '') { |
|
161 | + if ($clientIdentifier !== '') { |
|
162 | 162 | $client = $this->clientMapper->getByIdentifier($clientIdentifier); |
163 | 163 | $clientName = $client->getName(); |
164 | 164 | } |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | */ |
216 | 216 | public function redirectPage($stateToken = '', |
217 | 217 | $clientIdentifier = '') { |
218 | - if(!$this->isValidToken($stateToken)) { |
|
218 | + if (!$this->isValidToken($stateToken)) { |
|
219 | 219 | return $this->stateTokenForbiddenResponse(); |
220 | 220 | } |
221 | 221 | |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | */ |
243 | 243 | public function generateAppPassword($stateToken, |
244 | 244 | $clientIdentifier = '') { |
245 | - if(!$this->isValidToken($stateToken)) { |
|
245 | + if (!$this->isValidToken($stateToken)) { |
|
246 | 246 | $this->session->remove(self::stateName); |
247 | 247 | return $this->stateTokenForbiddenResponse(); |
248 | 248 | } |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | |
274 | 274 | $clientName = $this->getClientName(); |
275 | 275 | $client = false; |
276 | - if($clientIdentifier !== '') { |
|
276 | + if ($clientIdentifier !== '') { |
|
277 | 277 | $client = $this->clientMapper->getByIdentifier($clientIdentifier); |
278 | 278 | $clientName = $client->getName(); |
279 | 279 | } |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | IToken::DO_NOT_REMEMBER |
291 | 291 | ); |
292 | 292 | |
293 | - if($client) { |
|
293 | + if ($client) { |
|
294 | 294 | $code = $this->random->generate(128); |
295 | 295 | $accessToken = new AccessToken(); |
296 | 296 | $accessToken->setClientId($client->getId()); |
@@ -327,8 +327,8 @@ discard block |
||
327 | 327 | } |
328 | 328 | |
329 | 329 | |
330 | - $serverPath = $protocol . "://" . $this->request->getServerHost() . $serverPostfix; |
|
331 | - $redirectUri = 'nc://login/server:' . $serverPath . '&user:' . urlencode($loginName) . '&password:' . urlencode($token); |
|
330 | + $serverPath = $protocol."://".$this->request->getServerHost().$serverPostfix; |
|
331 | + $redirectUri = 'nc://login/server:'.$serverPath.'&user:'.urlencode($loginName).'&password:'.urlencode($token); |
|
332 | 332 | } |
333 | 333 | |
334 | 334 | // Clear the token from the login here |