skip to Main Content

Laravel Socialite Google OAuth with Sanctum: Session created but user_id is null after login

I'm building an API-only SPA with Laravel Sanctum and Nuxt3, using cookie-based session authentication. I’ve implemented Google OAuth using Laravel Socialite. Here’s my current setup for the Google OAuth flow: public function googleCallback() { $googleUser = Socialite::driver('google')->stateless()->user(); $user = $this->authRepository->show($googleUser->email);…

VIEW QUESTION

Socialite: Login with Google Client error – Twitter API

I'm using stateless fromUserToken and this is the error I'm getting: "errors": { "error": "Client error: `GET https://www.googleapis.com/oauth2/v3/userinfo?prettyPrint=false` resulted in a `401 Unauthorized` response:n{n "error": "invalid_request",n "error_description": "Invalid Credentials"n}n", "code": 401 } this is my endpoint that I use, it…

VIEW QUESTION
Back To Top
Search