1 | <?php namespace Arcanesoft\Auth\Http\Controllers\Front; |
||
14 | class SocialAuthController extends Controller |
||
15 | { |
||
16 | /* ------------------------------------------------------------------------------------------------ |
||
17 | | Properties |
||
18 | | ------------------------------------------------------------------------------------------------ |
||
19 | */ |
||
20 | /** |
||
21 | * Where to redirect users after login / registration. |
||
22 | * |
||
23 | * @var string |
||
24 | */ |
||
25 | protected $redirectTo = '/home'; |
||
26 | |||
27 | /* ------------------------------------------------------------------------------------------------ |
||
28 | | Main Functions |
||
29 | | ------------------------------------------------------------------------------------------------ |
||
30 | */ |
||
31 | /** |
||
32 | * Redirect the user to the OAuth Provider. |
||
33 | * |
||
34 | * @param string $socialProvider |
||
35 | * |
||
36 | * @return \Symfony\Component\HttpFoundation\RedirectResponse |
||
37 | */ |
||
38 | public function redirectToProvider($socialProvider) |
||
42 | |||
43 | /** |
||
44 | * Obtain the user information from provider. |
||
45 | * |
||
46 | * @param string $socialProvider |
||
47 | * |
||
48 | * @return \Illuminate\Http\RedirectResponse |
||
49 | */ |
||
50 | public function handleCallback($socialProvider) |
||
60 | |||
61 | /* ------------------------------------------------------------------------------------------------ |
||
62 | | Other Functions |
||
63 | | ------------------------------------------------------------------------------------------------ |
||
64 | */ |
||
65 | /** |
||
66 | * Find or create a user. |
||
67 | * |
||
68 | * @param \Laravel\Socialite\One\User|\Laravel\Socialite\Two\User $user |
||
69 | * @param string $provider |
||
70 | * |
||
71 | * @return \Arcanesoft\Contracts\Auth\Models\User |
||
72 | */ |
||
73 | private function findOrCreateUser($user, $provider) |
||
86 | |||
87 | /** |
||
88 | * Get the social provider. |
||
89 | * |
||
90 | * @param string $driver |
||
91 | * |
||
92 | * @return \Laravel\Socialite\One\AbstractProvider|\Laravel\Socialite\Two\AbstractProvider |
||
93 | */ |
||
94 | private function getSocialProvider($driver) |
||
101 | } |
||
102 |