Adding extra fields to the default schema #16
-
|
its safe to adding extra fields to the default schema ? and the validated in the core config of the library ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Yes, adding extra columns to Your callback is the right place to validate input. Return an error (e.g. A few notes:
Future Limen updates shouldn't break custom columns as they are additive. If you're adding credentialpassword.WithUsernameSupport(true),
credentialpassword.WithRequireUsernameOnSignUp(true),Use Docs: Schema |
Beta Was this translation helpful? Give feedback.
Yes, adding extra columns to
usersand persisting them withWithUserAdditionalFieldsis supported and safe.Your callback is the right place to validate input. Return an error (e.g.
limen.NewLimenError(...)) to reject bad data; returned map keys must match your DB column names.A few notes:
ALTER TABLE).ctx.GetBody() == nil— the callback can run outside HTTP requests."first_name is required"but checks"username".first_name/last_nameunless you useWithUserIncludeNameFields(false).Future Limen updates shouldn…