diff --git a/lib/accounts/user.ex b/lib/accounts/user.ex index daf29ba..970e65f 100644 --- a/lib/accounts/user.ex +++ b/lib/accounts/user.ex @@ -96,14 +96,14 @@ defmodule Mv.Accounts.User do argument :oauth_tokens, :map, allow_nil?: false prepare AshAuthentication.Strategy.OAuth2.SignInPreparation - filter expr(email == get_path(^arg(:user_info), [:email])) + filter expr(email == get_path(^arg(:user_info), [:preferred_username])) end create :register_with_rauthy do argument :user_info, :map, allow_nil?: false argument :oauth_tokens, :map, allow_nil?: false upsert? true - upsert_identity :unique_email + upsert_identity :unique_oidc_id change AshAuthentication.GenerateTokenChange