Closed liam-m closed 8 years ago
The only problem with the 2 line change I can think of is that a new user would be created if they log out then log in after changing their picture?
However, this issue already exists with the user changing their name.
This problem can be avoided by only passing the email attribute to first_or_create and passing a block as the second argument, which sets the other attributes. This block is only executed when the instance is created.
@ReverateNM has started this on the auth-feat/profile-pictures branch (https://github.com/Lixquid/flippd/commit/2ca2ffbee3617139d675fef2d26d23f3b420bd3c, https://github.com/Lixquid/flippd/commit/a962b50972470f2d285c4662dfc50343316904a0, https://github.com/Lixquid/flippd/commit/a28923c28c1c4633d25411ef57e1befc62e5380b, https://github.com/Lixquid/flippd/commit/78dcaa5159cc1c4bf4171d7d16125e16220fd972, https://github.com/Lixquid/flippd/commit/ab9c13f9aa9972da62031cb7f7fd77657696a859)
We'd like to display the user's profile image to display next to comments.
This is available in the Auth Hash Schema (need to double check Google returns it though).
I think this should just be a 2 line change - add the field to the user model and then pass it to the constructor in the auth callback.
Subtask for #31