Initial version of native session management

This commit is contained in:
2025-01-14 20:53:49 +01:00
parent 4da9792b0f
commit d953b4135c
15 changed files with 397 additions and 479 deletions

View File

@ -9,9 +9,9 @@ import (
f "streifling.com/jason/cpolis/cmd/frontend"
)
func ServeImage(c *b.Config, s *b.CookieStore) http.HandlerFunc {
func ServeImage(c *b.Config, s map[string]*f.Session) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
if _, err := f.GetSession(w, r, c, s); err != nil {
if _, err := f.ManageSession(w, r, c, s); err != nil {
if !tokenIsVerified(w, r, c) {
return
}