added comments
This commit is contained in:
@ -14,11 +14,13 @@ const (
|
||||
RoleGuest Role = "guest"
|
||||
)
|
||||
|
||||
// InvalidJWT Represents a JWT that has expired or is otherwise invalid.
|
||||
type InvalidJWT struct {
|
||||
JWT string `gorm:"primarykey"`
|
||||
ValidUntil time.Time
|
||||
}
|
||||
|
||||
// User represents a user with an ID, UUID, name, role, and password.
|
||||
type User struct {
|
||||
ID uint `gorm:"primarykey" json:"-"`
|
||||
UUID uuid.UUID `gorm:"type:uuid" json:"uuid"`
|
||||
@ -27,6 +29,7 @@ type User struct {
|
||||
Password []byte `json:"-"`
|
||||
}
|
||||
|
||||
// NewUser creates a new User struct with a generated UUID.
|
||||
func NewUser() User {
|
||||
return User{
|
||||
UUID: uuid.New(),
|
||||
|
Reference in New Issue
Block a user