| 1 | <?php |
||
| 10 | class GithubAuthController extends Controller |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * Redirect the user to the GitHub authentication page. |
||
| 14 | * |
||
| 15 | * @return Response |
||
| 16 | */ |
||
| 17 | public function redirectToProvider() |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Obtain the user information from GitHub. |
||
| 26 | * |
||
| 27 | * @return Response |
||
| 28 | */ |
||
| 29 | public function handleProviderCallback() |
||
| 43 | |||
| 44 | /** |
||
| 45 | * Create and return user if doesn't exist. Update and return otherwise. |
||
| 46 | * |
||
| 47 | * @param $githubUser |
||
| 48 | * @return User |
||
| 49 | */ |
||
| 50 | private function findOrCreateUser($githubUser) |
||
| 64 | |||
| 65 | /** |
||
| 66 | * Logout user |
||
| 67 | * |
||
| 68 | * @return \Illuminate\Http\RedirectResponse |
||
| 69 | */ |
||
| 70 | public function logout() |
||
| 76 | } |
||
| 77 |