Handle user creation upon registration.
This commit is contained in:
parent
79d2db3c1f
commit
8657380530
13 changed files with 201 additions and 46 deletions
|
|
@ -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(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue