Added user authentication

This commit is contained in:
Leon Mika 2025-02-01 09:42:32 +11:00
parent d7e7af5a10
commit cb54057305
40 changed files with 710 additions and 218 deletions

9
models/cookie.go Normal file
View file

@ -0,0 +1,9 @@
package models
const (
AuthCookieName = "hugocrm_auth"
)
type AuthCookie struct {
UserID int64 `json:"uid"`
}

View file

@ -12,6 +12,7 @@ const (
type Post struct {
ID int64
SiteID int64
OwnerID int64
Title string
Body string
State PostState

View file

@ -1,9 +1,10 @@
package models
type Site struct {
ID int64
Name string
Title string
URL string
Theme string
ID int64
OwnerUserID int64
Name string
Title string
URL string
Theme string
}

7
models/user.go Normal file
View file

@ -0,0 +1,7 @@
package models
type User struct {
ID int64
Email string
PasswordHash string
}