Where is (auth) Display Name populated from? #20060
-
Using auth.SignUp with email, password, in some testing i ended up with an first and last name in the Display Name field of the auth table. However, for the life of me I can't recall how I did that. And can't replicate it. I am using a public profile table as well, but would like the display name in the auth table as well. Any idea how to populate the Display Name field? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 11 replies
-
This comes from OAuth providers and is stored in the raw_user_meta_data column. It is derived from many possible keys there but display_name is one of them. |
Beta Was this translation helpful? Give feedback.
-
Haven't seen the code but wanted to add, I am not using display_name and stumbled into this simply by adding first and last name collection. In my public.users (terrible I know should have public.profile), I added a display_name that was independent of anything, so probably will rework it now to just be first + last (got a trigger/func to move the names into the public.users).
|
Beta Was this translation helpful? Give feedback.
-
Wanted to add this here just in case someone else comes across this. I'm using sveltekit and in my +page.server.ts action, I'm doing this: const creds: SignUpWithPasswordCredentials = {
email,
password,
options: {
data: {display_name: `${fName} ${lName}`}
}
}
const {data, error} = await supabase.auth.signUp(creds) |
Beta Was this translation helpful? Give feedback.
-
Print the enter metadata and pick what you want from it. print(user?.userMetadata); In my case, I wanted to full name. So, here is what I implemented: user?.userMetadata?['full_name'] ?? "Full Name", |
Beta Was this translation helpful? Give feedback.
This comes from OAuth providers and is stored in the raw_user_meta_data column. It is derived from many possible keys there but display_name is one of them.