i have this on link pop up
<a href="login/google" class="btn btn-white btn-outline-white"><span class="fa fa-google">oogle</span></a>
My route
Route::get('login/google', [GoogleController::class, 'login']);
Route::get('login/google/callback', [GoogleController::class, 'callback']);
Route::middleware(['auth'])->group(function () {
Route::get('logout', [GoogleController::class, 'logout']);
Route::get('user', [UserController::class, 'index']);
});
authorize redirect url from google cloud platform
services.php
'google' => [
'client_id' => env('GOOGLE_CLIENT_ID'),
'client_secret' => env('GOOGLE_CLIENT_SECRET'),
'redirect' => 'http://127.0.0.1:8000/login/google/callback',
my controller
public function login() {
return Socialite::driver('google')->redirect();
}
public function callback() {
try {
$google_user = Socialite::driver('google')->user();
$user = User::where('email', $google_user->email)->first();
if($user) {
Auth::login($user);
return redirect('user');
}
else {
$new_user = User::create([
'name'=> ucwords($google_user->name),
'email'=> $google_user->email,
'email_verified_at'=> now(),
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',
'remember_token'=> Str::random(10),
]);
Auth::login($new_user);
return redirect('user');
}
} catch (\Throwable $th) {
abort(404);
}
}
but still got this message enter image description here
i hope you guys can help me, i have to finish this before my thesis defence