Sessions in etcd KV store instead of cookies

This commit is contained in:
2022-10-30 20:11:36 +01:00
parent c2c6a72f81
commit f4c2d61dc3
41 changed files with 1008 additions and 202 deletions

View File

@@ -4,14 +4,16 @@ import (
"encoding/json"
"html/template"
"net/http"
mobilityaccountsstorage "git.coopgo.io/coopgo-platform/mobility-accounts/storage"
)
const beneficiariesMenu = "beneficiaries"
type BeneficiariesListState struct {
Count int `json:"count"`
CacheId string `json:"cache_id"`
Beneficiaries []any `json:"beneficiaries"`
Count int `json:"count"`
CacheId string `json:"cache_id"`
Beneficiaries []mobilityaccountsstorage.Account `json:"beneficiaries"`
}
func (s BeneficiariesListState) JSON() template.JS {
@@ -26,7 +28,7 @@ func (s BeneficiariesListState) JSONWithLimits(a int, b int) template.JS {
return s.JSON()
}
func (renderer *Renderer) BeneficiariesList(w http.ResponseWriter, r *http.Request, accounts []any, cacheid string) {
func (renderer *Renderer) BeneficiariesList(w http.ResponseWriter, r *http.Request, accounts []mobilityaccountsstorage.Account, cacheid string) {
files := renderer.ThemeConfig.GetStringSlice("views.beneficiaries.list.files")
state := NewState(r, renderer.ThemeConfig, beneficiariesMenu)