-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does validateUser() reload $auth.user from the backend? #176
Comments
I am also interested in how/where the lib updates the $auth.user. I am using a NodeJS backend. On page refresh I lose the details passed by $auth.authenticate(). |
after reading the ReadMe several times, I noticed https://github.com/lynndylanhurley/ng-token-auth#using-alternate-response-formats says what I am doing wrong. Basically, the validate_token endpoint needs to have a data param with the user data. |
Closing this since it seems like the issue has been worked out. Please let me know if I need to re-open @davidtlee |
Hey @angelxmoreno and @booleanbetrayal, sorry for being so MIA with responding. @angelxmoreno: I don't think that's my issue, because I use devise-token-auth, which should already be using the correct format. @angelxmoreno and @booleanbetrayal: that being said, I haven't really seen this bug lately (only happens with creating a new user and I haven't really tested that recently). I think we can keep this closed. When I get back to it, I'll dig into it more if the bug still exists and reopen the issue if applicable. Thanks! |
In my app, I have a
phone_verified
boolean column onuser
. If the user has verified their phone, I route them to the main app, if not, I route them to an onboarding process.Right now, after a user goes through onboarding, I can see that
u.phone_verified
is true for that user (through the rails console). However, on the frontend, it still believes thatu.phone_verified
is false. The place where I route the user is within an$auth.validateUser()
callback, so I was thinking that the user object within the callback should be updated. But analert(user.phone_verified)
indicates that this column is still false.So my question is: Does
$auth.validateUser()
go to the server and get the user object? If not, how can I get the user object?Other configuration notes that might be relevant just in case:
config.change_headers_on_each_request = false
omniauth_callbacks_controller#omniauth_success
action and theomniauth_response.html.erb
andomniauth_success.html.erb
templatesThanks!
The text was updated successfully, but these errors were encountered: