fix: update email field given by oidc provider

This commit is contained in:
Moritz 2025-07-22 23:59:01 +02:00
parent 24d6020117
commit 2accfffa46
Signed by: moritz
GPG key ID: 1020A035E5DD0824

View file

@ -88,14 +88,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