From 33d4fa66c8c2eaf940e29918d822042a2515f11a Mon Sep 17 00:00:00 2001 From: Moritz Date: Tue, 22 Jul 2025 23:59:01 +0200 Subject: [PATCH] fix: update email field given by oidc provider --- lib/accounts/user.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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