This commit is contained in:
lbenedar
2026-03-20 18:07:41 +03:00
parent efb58d7c15
commit 891b63f259
5 changed files with 88 additions and 1 deletions

View File

@@ -15,6 +15,8 @@ var (
ErrDuplicateEmail = errors.New("duplicate email")
)
var AnonymousUser = &User{}
type User struct {
ID int64 `json:"id"`
CreatedAt time.Time `json:"created_at"`
@@ -25,6 +27,10 @@ type User struct {
Version int `json:"-"`
}
func (u *User) IsAnonymous() bool {
return u == AnonymousUser
}
type password struct {
plaintext *string
hash []byte