Skip to content

Commit

Permalink
improvement: Add id as an option for sourcing uid for UserIdentity (#481
Browse files Browse the repository at this point in the history
)
  • Loading branch information
lawik authored Oct 25, 2023
1 parent 5476653 commit 625e0e6
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ defmodule AshAuthentication.UserIdentity.UpsertIdentityChange do

uid =
user_info
|> Map.take(["uid", "sub"])
# uid is a convention
# sub is supposedly from the spec
# id is from what has been seen from Google
|> Map.take(["uid", "sub", "id"])
|> Map.values()
|> Enum.reject(&is_nil/1)
|> List.first()
Expand Down

0 comments on commit 625e0e6

Please sign in to comment.