1

I have a web app with a Google plus login button. What I want to do is to have the app be notified that the user has logged in once the login process on the google side completes (in a new tab).

The server can of course detect that the client has logged in once the process finishes, since google redirects it to a callback url on the server, but how can this information be passed on to the client?

simonzack
  • 19,729
  • 13
  • 73
  • 118
  • As far I understood you use OAuth(you added passport tag to your post). The typical flow is that from server side you get redirected to callback URL. There are multiple ways to pass data to client side, JWT, write the state in HTML etc. – Risto Novik Jun 12 '17 at 08:10
  • @RistoNovik Yea but the issue is that I don't want the tab to refresh. Is there a standard way to do that? I'm thinking of hacks like local storage events but surely it shouldn't be complicated. – simonzack Jun 12 '17 at 08:23
  • Take a look at this question, https://stackoverflow.com/questions/21451172/how-to-integrate-oauth-with-a-single-page-application. The problem is there, is no silver bullet solution for SPA. – Risto Novik Jun 12 '17 at 09:11

0 Answers0