Updated User model fields
This commit is contained in:
@@ -31,7 +31,7 @@ func Login(ctx *fiber.Ctx) error {
|
||||
}
|
||||
|
||||
user := new(models.User)
|
||||
result := db.Where(&models.User{Username: body.Username, Password: body.Password}).Select("id").First(user)
|
||||
result := db.Where(&models.User{Login: body.Username, Password: body.Password}).Select("id").First(user)
|
||||
|
||||
if result.Error != nil {
|
||||
return errors.New("invalid combination of username and password")
|
||||
|
@@ -30,7 +30,7 @@ func Register(ctx *fiber.Ctx) error {
|
||||
return err
|
||||
}
|
||||
|
||||
user := models.User{ID: database.GetID(), Username: body.Username, Password: body.Password, Email: body.Email}
|
||||
user := models.User{ID: database.GetID(), Login: body.Username, Password: body.Password, Email: body.Email}
|
||||
result := db.Create(&user)
|
||||
if result.Error != nil {
|
||||
return result.Error
|
||||
|
Reference in New Issue
Block a user