0

I have a Laravel 5.5 application with Login with Google using Socialite. It works in development. I click the login with Google button, sign in and am redirected back to the user dashboard via a callback route. In production though I click the button, sign in via google and then am redirected back to the same home page and not logged in.

On dev I run the site at http://localhost:8000 and production my site runs at http://www.employbl.com. These are my authorized redirect URLs in the Google console:

enter image description here

The site is hosted on heroku and my dns provider is google domains. What can I do to make sure sign in with Google works both locally and in production?

Connor Leech
  • 18,052
  • 30
  • 105
  • 150
  • If you open google Chrome inspector what do you see when (if) your callback url is invoked? Http code? Answer? – koalaok Jul 09 '18 at 20:44
  • After I sign in in production it goes to: `http://employbl.com/callback?state=XXXXXX&code=XXXXXXX&authuser=1&session_state=XXXXX&prompt=none` and then redirects me to `http://www.employbl.com/#`. In development it calls `http://localhost:8000/callback?state=XXXXXX&code=XXXXXX&authuser=0&session_state=XXXXX&prompt=consent` and then logs me in and redirects to `http://localhost:8000/dashboard` like it is supposed to with logged in users. In both cases the status code is 302 – Connor Leech Jul 09 '18 at 20:56
  • I think the problem is on your (server) side.... maybe it's logging but the session is not started.... place some Log around into the Controller method who handles the callback – koalaok Jul 09 '18 at 21:04

0 Answers0