This commit is contained in:
ct
2025-07-01 23:13:09 +08:00
parent 79e7d7a49e
commit 209c022f1d
26 changed files with 374 additions and 50 deletions

View File

@@ -4,6 +4,7 @@
use App;
use App\Models\User;
use App\Models\UserPlan;
use Illuminate\Support\Facades\Auth;
use Laravel\Socialite\Facades\Socialite;
@@ -60,7 +61,7 @@ public function handleGoogleCallback()
}
}
return redirect()->intended(route('home'));
return redirect()->intended(route('home'))->with('success', "You're now logged in!");
} catch (\Exception $e) {
throw $e;
@@ -73,7 +74,17 @@ public function handleGoogleCallback()
}
}
private function setupUser($user) {}
private function setupUser($user)
{
$user_plan = UserPlan::where('user_id', $user->id)->first();
if (!$user_plan) {
$user_plan = UserPlan::create([
'user_id' => $user->id,
'plan_id' => 'free',
]);
}
}
private function getMockGoogleUser()
{