daranguiz / barbell-io

Lift yourself up by your Bootstrap(s)
http://barbell.io
MIT License
1 stars 2 forks source link

Switch to OAuth #7

Closed daranguiz closed 7 years ago

daranguiz commented 7 years ago

The tutorial I was using at the beginning ran OpenID, but that protocol is wildly out of date. At minimum, allow for authentication via Google and Facebook.

Also allow users to select their own username if logging into the site for the first time rather than autogenerating from their OAuth data.

daranguiz commented 7 years ago

This will probably be useful: http://blog.miguelgrinberg.com/post/oauth-authentication-with-flask

daranguiz commented 7 years ago

OAuth is done, now two things left before closing this issue:

kashev commented 7 years ago

If you do let users change usernames, be sure to include something that does not change in their user table or something, some sort or UUID.

One way that I think is a nice way to do it is have username be an email address, which ensures uniqueness for you externally, and then let users give themselves a nickname, which you can also enforce is unique across the site. Then, nicknames are easy to change, and usernames do not change (as often).

daranguiz commented 7 years ago

https://github.com/daranguiz/barbell-io/blob/master/app/models.py

I'm sort of already doing that?

All enforced to be unique.

Anyway, I'm not sure the best way to do this. For relationships in the DB (user -> lift entries, at some point user -> user social following stuff), I'm planning on using the ID. To check if it's a new user, I'm comparing against the UID. Maybe it would be better to compare against the email.

kashev commented 7 years ago

sgtm

daranguiz commented 7 years ago

Forgot to close w/commit, but, done

kashev commented 7 years ago

You should reference the specific commit that closes the issue when you do this

daranguiz commented 7 years ago

Didn't know the right way to do this

25fd9c2aace404a293495b9cb44836f35dd56570