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