Skip to content
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

Check UIDs instead of auth tokens #22

Closed
wants to merge 3 commits into from
Closed

Check UIDs instead of auth tokens #22

wants to merge 3 commits into from

Conversation

mercury2269
Copy link

Fix for issue #12

@mercury2269 mercury2269 reopened this Mar 15, 2016
else
{:error, :token_mismatch}
end
authorization -> authorization
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if authorization is found using UID and provider we simply return it without checking the tokens. Token checks prevents users from logging out and then logging back again, because tokens change between authorizations.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens in this case though? We have an authorization that represents 'google' for user x. If the token is different it's still the same record correct? We would just need to update the token provided (I think)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hassox I would put it somewhere in between here https://github.com/hassox/phoenix_guardian/blob/ueberauth-guardian/web/auth/user_from_auth.ex#L11

After everything when throw without any problem with the user or the authorization. We check if the token is different (I don't know the correlation with expires_at) and save the newest token so we keep the latest token in our end.

Make sense?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants