Added user email verification support.
This commit is contained in:
parent
6ec7118c3d
commit
c31f30ba5c
31 changed files with 417 additions and 85 deletions
|
|
@ -6,13 +6,12 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/mikestefanello/pagoda/ent/passwordtoken"
|
||||
"github.com/mikestefanello/pagoda/ent/predicate"
|
||||
"github.com/mikestefanello/pagoda/ent/user"
|
||||
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"entgo.io/ent/dialect/sql/sqlgraph"
|
||||
"entgo.io/ent/schema/field"
|
||||
"github.com/mikestefanello/pagoda/ent/passwordtoken"
|
||||
"github.com/mikestefanello/pagoda/ent/predicate"
|
||||
"github.com/mikestefanello/pagoda/ent/user"
|
||||
)
|
||||
|
||||
// UserUpdate is the builder for updating User entities.
|
||||
|
|
@ -46,6 +45,20 @@ func (uu *UserUpdate) SetPassword(s string) *UserUpdate {
|
|||
return uu
|
||||
}
|
||||
|
||||
// SetVerified sets the "verified" field.
|
||||
func (uu *UserUpdate) SetVerified(b bool) *UserUpdate {
|
||||
uu.mutation.SetVerified(b)
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetNillableVerified sets the "verified" field if the given value is not nil.
|
||||
func (uu *UserUpdate) SetNillableVerified(b *bool) *UserUpdate {
|
||||
if b != nil {
|
||||
uu.SetVerified(*b)
|
||||
}
|
||||
return uu
|
||||
}
|
||||
|
||||
// AddOwnerIDs adds the "owner" edge to the PasswordToken entity by IDs.
|
||||
func (uu *UserUpdate) AddOwnerIDs(ids ...int) *UserUpdate {
|
||||
uu.mutation.AddOwnerIDs(ids...)
|
||||
|
|
@ -206,6 +219,13 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
|||
Column: user.FieldPassword,
|
||||
})
|
||||
}
|
||||
if value, ok := uu.mutation.Verified(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeBool,
|
||||
Value: value,
|
||||
Column: user.FieldVerified,
|
||||
})
|
||||
}
|
||||
if uu.mutation.OwnerCleared() {
|
||||
edge := &sqlgraph.EdgeSpec{
|
||||
Rel: sqlgraph.O2M,
|
||||
|
|
@ -297,6 +317,20 @@ func (uuo *UserUpdateOne) SetPassword(s string) *UserUpdateOne {
|
|||
return uuo
|
||||
}
|
||||
|
||||
// SetVerified sets the "verified" field.
|
||||
func (uuo *UserUpdateOne) SetVerified(b bool) *UserUpdateOne {
|
||||
uuo.mutation.SetVerified(b)
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetNillableVerified sets the "verified" field if the given value is not nil.
|
||||
func (uuo *UserUpdateOne) SetNillableVerified(b *bool) *UserUpdateOne {
|
||||
if b != nil {
|
||||
uuo.SetVerified(*b)
|
||||
}
|
||||
return uuo
|
||||
}
|
||||
|
||||
// AddOwnerIDs adds the "owner" edge to the PasswordToken entity by IDs.
|
||||
func (uuo *UserUpdateOne) AddOwnerIDs(ids ...int) *UserUpdateOne {
|
||||
uuo.mutation.AddOwnerIDs(ids...)
|
||||
|
|
@ -481,6 +515,13 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error)
|
|||
Column: user.FieldPassword,
|
||||
})
|
||||
}
|
||||
if value, ok := uuo.mutation.Verified(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeBool,
|
||||
Value: value,
|
||||
Column: user.FieldVerified,
|
||||
})
|
||||
}
|
||||
if uuo.mutation.OwnerCleared() {
|
||||
edge := &sqlgraph.EdgeSpec{
|
||||
Rel: sqlgraph.O2M,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue