| @@ 19-27 (lines=9) @@ | ||
| 16 | public static function auth() |
|
| 17 | { |
|
| 18 | $config = static::getConfig(); |
|
| 19 | if (empty($_GET['code']) && empty($_GET['error'])) { |
|
| 20 | $query = [ |
|
| 21 | 'client_id' => $config['appId'], |
|
| 22 | 'scope' => 'email', |
|
| 23 | 'response_type' => 'code', |
|
| 24 | 'redirect_uri' => 'http://' . INJI_DOMAIN_NAME . '/users/social/auth/facebook' |
|
| 25 | ]; |
|
| 26 | \Tools::redirect("https://www.facebook.com/dialog/oauth?" . http_build_query($query)); |
|
| 27 | } |
|
| 28 | if (empty($_GET['code']) && !empty($_GET['error'])) { |
|
| 29 | \Tools::redirect('/', 'Произошла ошибка во время авторизации через соц. сеть: ' . $_GET['error_description']); |
|
| 30 | } |
|
| @@ 20-28 (lines=9) @@ | ||
| 17 | { |
|
| 18 | ||
| 19 | $config = static::getConfig(); |
|
| 20 | if (empty($_GET['code']) && empty($_GET['error'])) { |
|
| 21 | $query = [ |
|
| 22 | 'client_id' => $config['client_id'], |
|
| 23 | 'scope' => 'https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile', |
|
| 24 | 'response_type' => 'code', |
|
| 25 | 'redirect_uri' => 'http://' . INJI_DOMAIN_NAME . '/users/social/auth/google' |
|
| 26 | ]; |
|
| 27 | \Tools::redirect("https://accounts.google.com/o/oauth2/auth?" . http_build_query($query)); |
|
| 28 | } |
|
| 29 | if (empty($_GET['code']) && !empty($_GET['error'])) { |
|
| 30 | \Tools::redirect('/', 'Произошла ошибка во время авторизации через соц. сеть: ' . $_GET['error_description']); |
|
| 31 | } |
|
| @@ 19-28 (lines=10) @@ | ||
| 16 | public static function auth() |
|
| 17 | { |
|
| 18 | $config = static::getConfig(); |
|
| 19 | if (empty($_GET['code']) && empty($_GET['error'])) { |
|
| 20 | $query = [ |
|
| 21 | 'client_id' => $config['appId'], |
|
| 22 | 'scope' => 'email', |
|
| 23 | 'response_type' => 'code', |
|
| 24 | 'display' => 'page', |
|
| 25 | 'redirect_uri' => 'http://' . INJI_DOMAIN_NAME . '/users/social/auth/vk' |
|
| 26 | ]; |
|
| 27 | \Tools::redirect("https://oauth.vk.com/authorize?" . http_build_query($query)); |
|
| 28 | } |
|
| 29 | if (empty($_GET['code']) && !empty($_GET['error'])) { |
|
| 30 | \Tools::redirect('/', 'Произошла ошибка во время авторизации через соц. сеть: ' . $_GET['error_description']); |
|
| 31 | } |
|