Open SimonLab opened 4 years ago
Google and Github Oauth2 allow us to get basic information about the user. We are currently only saving in our Postgres person database the email of the user: https://github.com/dwyl/auth-mvp/blob/35799662801eaf1094d54797f00927aaccb3cc8b/lib/auth_mvp/people/person.ex#L8-L14
person
We want now to be able to save the profile image of the user. With Google the image url is already returned via ElixirAuthGoogle package under the picture value: https://github.com/dwyl/auth-mvp/blob/35799662801eaf1094d54797f00927aaccb3cc8b/lib/auth_mvp_web/controllers/google_auth_controller.ex#L9
picture
With Github the value to get will be saved under avatar_url
avatar_url
avatar
cast
def changeset(person, attrs) do person |> cast(attrs, [:email, :verified]) |> validate_required([:email, :verified]) end
Google and Github Oauth2 allow us to get basic information about the user. We are currently only saving in our Postgres
person
database the email of the user: https://github.com/dwyl/auth-mvp/blob/35799662801eaf1094d54797f00927aaccb3cc8b/lib/auth_mvp/people/person.ex#L8-L14We want now to be able to save the profile image of the user. With Google the image url is already returned via ElixirAuthGoogle package under the
picture
value: https://github.com/dwyl/auth-mvp/blob/35799662801eaf1094d54797f00927aaccb3cc8b/lib/auth_mvp_web/controllers/google_auth_controller.ex#L9With Github the value to get will be saved under
avatar_url
avatar
string fieldavatar
field in the databasecast
the avatar value: