Handle user creation upon registration.

This commit is contained in:
mikestefanello 2021-12-11 13:03:10 -05:00
parent 79d2db3c1f
commit 8657380530
13 changed files with 201 additions and 46 deletions

View file

@ -16,9 +16,11 @@ type User struct {
func (User) Fields() []ent.Field {
return []ent.Field{
field.String("username").
Unique(),
Unique().
NotEmpty(),
field.String("password").
Sensitive(),
Sensitive().
NotEmpty(),
field.Time("created_at").
Default(time.Now).
Immutable(),