| Conditions | 5 |
| Paths | 6 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | public function redirect(array $scopes = [], array $options = [], $state = null) |
||
| 13 | { |
||
| 14 | if (!empty($scopes)) { |
||
| 15 | $options['scope'] = $scopes; |
||
| 16 | } |
||
| 17 | |||
| 18 | if (!$this->isStateless) { |
||
| 19 | $this->getSession()->set(self::OAUTH2_SESSION_STATE_KEY, $state ?: $this->provider->getState()); |
||
| 20 | if ($state) { |
||
| 21 | $this->provider->setState($state); |
||
| 22 | } |
||
| 23 | } |
||
| 24 | |||
| 25 | $options['state'] = $state; |
||
| 26 | $url = $this->provider->getAuthorizationUrl($options); |
||
| 27 | |||
| 28 | return new RedirectResponse($url); |
||
| 29 | } |
||
| 31 |