public function handleGithubOAuth()
{
try {
$user = Socialite::driver('github')->user();
} catch (Exception $e) {
return $this->redirectIntended('auth/github');
}
$authUser = $this->findOrCreateUser($user);
if (is_array($authUser)) {
Auth::login($authUser[0], true);
flashy()->mutedDark('注册成功,不过用户名可能要自己改个酷酷的');
return $this->redirectToRoute('user.profile');
} else {
Auth::login($authUser, true);
flashy()->message(lang('notification.register', 'Register Successfully!'));
return $this->redirectIntended('/');
}
}