diff options
| author | Fuwn <[email protected]> | 2026-02-10 00:25:43 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-02-10 00:25:43 -0800 |
| commit | 1bf443a5a98d0c21c0bf622114b8f87fdac8a5a7 (patch) | |
| tree | 7e4f82001192fc10f154f868e4e2f2c2ea9ff3ae /apps/web/app/reader | |
| parent | docs: replace boilerplate README with project documentation (diff) | |
| download | asa.news-1bf443a5a98d0c21c0bf622114b8f87fdac8a5a7.tar.xz asa.news-1bf443a5a98d0c21c0bf622114b8f87fdac8a5a7.zip | |
refactor: use Supabase Auth display name instead of custom column
Migrate existing display names from user_profiles to auth.users
user_metadata. Drop display_name column from user_profiles. Frontend
now reads from auth user metadata and updates via auth.updateUser().
Diffstat (limited to 'apps/web/app/reader')
| -rw-r--r-- | apps/web/app/reader/settings/_components/account-settings.tsx | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/apps/web/app/reader/settings/_components/account-settings.tsx b/apps/web/app/reader/settings/_components/account-settings.tsx index 9679e3b..298d80d 100644 --- a/apps/web/app/reader/settings/_components/account-settings.tsx +++ b/apps/web/app/reader/settings/_components/account-settings.tsx @@ -39,16 +39,9 @@ export function AccountSettings() { const updateDisplayName = useMutation({ mutationFn: async (displayName: string | null) => { - const { - data: { user }, - } = await supabaseClient.auth.getUser() - - if (!user) throw new Error("not authenticated") - - const { error } = await supabaseClient - .from("user_profiles") - .update({ display_name: displayName }) - .eq("id", user.id) + const { error } = await supabaseClient.auth.updateUser({ + data: { display_name: displayName }, + }) if (error) throw error }, |