Add authentication, styling needs to be fixed
# Conflicts: # starter/ent/runtime.go # starter/go.mod # starter/go.sum # starter/routes/routing.go
This commit is contained in:
+18
-18
@@ -6,13 +6,13 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"git.gorlug.de/code/ersteller/starter/ent/predicate"
|
||||
"git.gorlug.de/code/ersteller/starter/ent/user"
|
||||
"time"
|
||||
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"entgo.io/ent/dialect/sql/sqlgraph"
|
||||
"entgo.io/ent/schema/field"
|
||||
"git.gorlug.de/code/ersteller/starter/ent/predicate"
|
||||
"git.gorlug.de/code/ersteller/starter/ent/user"
|
||||
)
|
||||
|
||||
// UserUpdate is the builder for updating User entities.
|
||||
@@ -48,16 +48,16 @@ func (_u *UserUpdate) SetNillableEmail(v *string) *UserUpdate {
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetPassword sets the "password" field.
|
||||
func (_u *UserUpdate) SetPassword(v string) *UserUpdate {
|
||||
_u.mutation.SetPassword(v)
|
||||
// SetPasswordHash sets the "password_hash" field.
|
||||
func (_u *UserUpdate) SetPasswordHash(v string) *UserUpdate {
|
||||
_u.mutation.SetPasswordHash(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillablePassword sets the "password" field if the given value is not nil.
|
||||
func (_u *UserUpdate) SetNillablePassword(v *string) *UserUpdate {
|
||||
// SetNillablePasswordHash sets the "password_hash" field if the given value is not nil.
|
||||
func (_u *UserUpdate) SetNillablePasswordHash(v *string) *UserUpdate {
|
||||
if v != nil {
|
||||
_u.SetPassword(*v)
|
||||
_u.SetPasswordHash(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
@@ -118,8 +118,8 @@ func (_u *UserUpdate) sqlSave(ctx context.Context) (_node int, err error) {
|
||||
if value, ok := _u.mutation.Email(); ok {
|
||||
_spec.SetField(user.FieldEmail, field.TypeString, value)
|
||||
}
|
||||
if value, ok := _u.mutation.Password(); ok {
|
||||
_spec.SetField(user.FieldPassword, field.TypeString, value)
|
||||
if value, ok := _u.mutation.PasswordHash(); ok {
|
||||
_spec.SetField(user.FieldPasswordHash, field.TypeString, value)
|
||||
}
|
||||
if _node, err = sqlgraph.UpdateNodes(ctx, _u.driver, _spec); err != nil {
|
||||
if _, ok := err.(*sqlgraph.NotFoundError); ok {
|
||||
@@ -161,16 +161,16 @@ func (_u *UserUpdateOne) SetNillableEmail(v *string) *UserUpdateOne {
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetPassword sets the "password" field.
|
||||
func (_u *UserUpdateOne) SetPassword(v string) *UserUpdateOne {
|
||||
_u.mutation.SetPassword(v)
|
||||
// SetPasswordHash sets the "password_hash" field.
|
||||
func (_u *UserUpdateOne) SetPasswordHash(v string) *UserUpdateOne {
|
||||
_u.mutation.SetPasswordHash(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillablePassword sets the "password" field if the given value is not nil.
|
||||
func (_u *UserUpdateOne) SetNillablePassword(v *string) *UserUpdateOne {
|
||||
// SetNillablePasswordHash sets the "password_hash" field if the given value is not nil.
|
||||
func (_u *UserUpdateOne) SetNillablePasswordHash(v *string) *UserUpdateOne {
|
||||
if v != nil {
|
||||
_u.SetPassword(*v)
|
||||
_u.SetPasswordHash(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
@@ -261,8 +261,8 @@ func (_u *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error) {
|
||||
if value, ok := _u.mutation.Email(); ok {
|
||||
_spec.SetField(user.FieldEmail, field.TypeString, value)
|
||||
}
|
||||
if value, ok := _u.mutation.Password(); ok {
|
||||
_spec.SetField(user.FieldPassword, field.TypeString, value)
|
||||
if value, ok := _u.mutation.PasswordHash(); ok {
|
||||
_spec.SetField(user.FieldPasswordHash, field.TypeString, value)
|
||||
}
|
||||
_node = &User{config: _u.config}
|
||||
_spec.Assign = _node.assignValues
|
||||
|
||||
Reference in New Issue
Block a user