chore(webui): rewrite the web session code again while preparing for csrf tokens
All checks were successful
main / main (push) Successful in 7m12s
main / publish (push) Has been skipped
main / deploy (push) Has been skipped

#60
This commit is contained in:
Julien Dessaux 2025-04-30 22:31:25 +02:00
parent 3bb5e735c6
commit 895615ad6e
Signed by: adyxax
GPG key ID: F92E51B86E07177E
20 changed files with 162 additions and 149 deletions

View file

@ -2,7 +2,6 @@ package model
import (
"crypto/subtle"
"encoding/json"
"time"
"git.adyxax.org/adyxax/tfstated/pkg/helpers"
@ -12,15 +11,15 @@ import (
type AccountContextKey struct{}
type Account struct {
Id uuid.UUID
Username string
Salt []byte
PasswordHash []byte
IsAdmin bool
Created time.Time
LastLogin time.Time
Settings json.RawMessage
PasswordReset *uuid.UUID
Id uuid.UUID `json:"id"`
Username string `json:"username"`
Salt []byte `json:"salt"`
PasswordHash []byte `json:"password_hash"`
IsAdmin bool `json:"is_admin"`
Created time.Time `json:"created"`
LastLogin time.Time `json:"last_login"`
Settings *Settings `json:"settings"`
PasswordReset *uuid.UUID `json:"password_reset"`
}
func (account *Account) CheckPassword(password string) bool {