Added user authentication
This commit is contained in:
parent
d7e7af5a10
commit
cb54057305
40 changed files with 710 additions and 218 deletions
9
models/cookie.go
Normal file
9
models/cookie.go
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
package models
|
||||
|
||||
const (
|
||||
AuthCookieName = "hugocrm_auth"
|
||||
)
|
||||
|
||||
type AuthCookie struct {
|
||||
UserID int64 `json:"uid"`
|
||||
}
|
||||
|
|
@ -12,6 +12,7 @@ const (
|
|||
type Post struct {
|
||||
ID int64
|
||||
SiteID int64
|
||||
OwnerID int64
|
||||
Title string
|
||||
Body string
|
||||
State PostState
|
||||
|
|
|
|||
|
|
@ -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
7
models/user.go
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
package models
|
||||
|
||||
type User struct {
|
||||
ID int64
|
||||
Email string
|
||||
PasswordHash string
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue