sahat / satellizer

Token-based AngularJS Authentication
https://satellizer-sahat.rhcloud.com
MIT License
7.85k stars 1.13k forks source link

Login with Google OAuth2 Workflow Question #1137

Closed mkimmet closed 5 years ago

mkimmet commented 5 years ago

In the ReadMe under the section labeled "Login with OAuth 2.0" step 10 says "Parse the token and save it to Local Storage for subsequent use after page reload." Is this something that I have to do manually, or is it done automatically by satellizer? I don't see any code in the examples showing the token being saved in Local Storage for a Google Login, and my JWT token is not being saved.

mkimmet commented 5 years ago

I figured out my problem. In step 3 from the readme section "Login with OAuth 2.0," the code is returned via a GET request. I was taking the code and creating my JWT at that step, which was wrong. In step 5 it does a POST with the code, and when I moved my JWT creation to this point everything worked and satellizer saved the token automatically.