MCPcopy Create free account
hub / github.com/supabase/auth / UpdateUserMetaData

Method UpdateUserMetaData

internal/models/user.go:228–241  ·  view source on GitHub ↗

UpdateUserMetaData sets all user data from a map of updates, ensuring that it doesn't override attributes that are not in the provided map.

(tx *storage.Connection, updates map[string]interface{})

Source from the content-addressed store, hash-verified

226// ensuring that it doesn't override attributes that are not
227// in the provided map.
228func (u *User) UpdateUserMetaData(tx *storage.Connection, updates map[string]interface{}) error {
229 if u.UserMetaData == nil {
230 u.UserMetaData = updates
231 } else {
232 for key, value := range updates {
233 if value != nil {
234 u.UserMetaData[key] = value
235 } else {
236 delete(u.UserMetaData, key)
237 }
238 }
239 }
240 return tx.UpdateOnly(u, "raw_user_meta_data")
241}
242
243// UpdateAppMetaData updates all app data from a map of updates
244func (u *User) UpdateAppMetaData(tx *storage.Connection, updates map[string]interface{}) error {

Callers 9

ConfirmMethod · 0.95
SoftDeleteUserMethod · 0.95
processInviteMethod · 0.80
adminGenerateLinkMethod · 0.80
adminUserUpdateMethod · 0.80
UserUpdateMethod · 0.80

Calls 1

UpdateOnlyMethod · 0.80

Tested by 1