0

I have facebook and google login using socialite, facebook works but google I've only managed to get to work locally, so for example locally the url is http://dev.thesite.com and in production the url is https://thesite.com, that's the only difference, however when trying to log in with google in production i always get the invalidState exception

I've noticed that when I get the InvalidStateException, under environment and details I have:

REQUEST_URI  "/login/google/callback?state=EoWyQabT7M6wFKbPWyNJ5UD1jpLaID8v0RylvWll&code=4%2FuAFENTN62cKi-HJH7MLDFnrn8LtALjwi0zpd1Fmx688A6Vj_uSMDPk-p5EtQl_GayYKtcasjInfPjL6gfSImto8&scope=email+profile+openid+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email&authuser=0&session_state=84bdbb33a08cc16bbaf7584540c9b97deca3dafb..5d5c&prompt=consent"

QUERY_STRING    ""

So the QUERY_STRING is empty for some reason.

My .htaccess files redirects all requests to https, I believe that maybe some .htaccess setting can solve this.

Olaf Kock
  • 46,930
  • 8
  • 59
  • 90
jukenduit
  • 322
  • 3
  • 15
  • might be related to - [https://github.com/laravel/socialite/issues/389](https://github.com/laravel/socialite/issues/389) – Anuj Shrestha Dec 09 '19 at 07:17

1 Answers1

-1

go to config/session.php and set (without www)

'domain' => env('SESSION_DOMAIN', yourdomain.com),

and in console

php artisan cache:clear
composer dump-autoload

Delete all cookies from browser

sss S
  • 444
  • 2
  • 7
  • `cache:clear` is the for the cache store, it has nothing to do with the configuration cache – lagbox Dec 09 '19 at 09:16