| Conditions | 2 |
| Paths | 1 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | public function register(Container $app) |
||
| 21 | { |
||
| 22 | $app['oauth'] = function ($app) { |
||
| 23 | $socialite = (new SocialiteManager([ |
||
| 24 | 'wework' => [ |
||
| 25 | 'client_id' => $app['config']['corp_id'], |
||
| 26 | 'client_secret' => null, |
||
| 27 | 'redirect' => $this->prepareCallbackUrl($app), |
||
| 28 | ], |
||
| 29 | ], $app['request']))->driver('wework'); |
||
| 30 | |||
| 31 | $scopes = (array) $app['config']->get('oauth.scopes', ['snsapi_base']); |
||
| 32 | |||
| 33 | if (!empty($scopes)) { |
||
| 34 | $socialite->scopes($scopes); |
||
| 35 | } |
||
| 36 | |||
| 37 | return $socialite->setAccessToken(new AccessTokenDelegate($app)); |
||
| 38 | }; |
||
| 61 |