Implement initial login functionality

This commit is contained in:
Tom Wiesing 2022-12-05 16:14:54 +01:00
parent a3bd0db78c
commit 3aa79b0d23
No known key found for this signature in database
36 changed files with 908 additions and 70 deletions

15
internal/models/user.go Normal file
View file

@ -0,0 +1,15 @@
package models
// UserTable is the name of the table the [`User`] model is stored in.
const UserTable = "users"
// User represents a distillery user
type User struct {
Pk uint `gorm:"column:pk;primaryKey"`
User string `gorm:"column:user;not null;unique"` // name of the user
PasswordHash []byte `gorm:"column:password"` // password of the user, hashed
Enabled bool `gorm:"enabled;not null"`
Admin bool `gorm:"column:admin;not null"`
}