How to load user data after login in SPA?

Is there a website for SPA, more on the Vue, but not the essence. There is authorization through SOC. network. Do not quite understand how to do it right. Authorization goes like this: the user clicks on the authorize button, a new window opens, there is(example with Google) are asked to choose the account to authorize, after the data is sent to bacedasco part(PHP), after the logic is written to the hash in the cookie. There's a little problem, he always throws error Unknown authorization, but the data is coming from Google in the database are written. This is a problem. go ahead.

What to do next? To close a window using window.close. And then the question. To make a socket that will constantly ask whether the user is authorized by checking the cookie, not very familiar with sockets, so to talk nonsense. Or something from the window that I close my window.close to say that the main tab is updated and to check if there is a hash, then send a request for data? How to implement?
June 7th 19 at 14:53
1 answer
June 7th 19 at 14:55
Like, when the authorization goes through Google, it should not open a new window and there is a transition in the same window, to a server of Google in the page with the form selection of account/authorization. After selecting the account you straight back to your website in the redirectURI. To the redirectURI as you bind the server part and the client, to display or to send the user to the correct page after login.
Here, for example, you can check how the authorization via Google.
Can be different. And with the move and without. I need. so via a new window - victor.Erdman commented on June 7th 19 at 14:58

Find more questions by tags JavaScriptHTML