fix: update email field given by oidc provider

This commit is contained in:
Moritz 2025-07-22 23:59:01 +02:00 committed by moritz
parent 7a75f8f526
commit 33d4fa66c8

View file

@ -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