aboutsummaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authorAlexander Kavon <hawk@alexkavon.com>2023-11-30 20:10:41 -0500
committerAlexander Kavon <hawk@alexkavon.com>2023-11-30 20:10:50 -0500
commit17af6e1a5017285b680a7d0a1dace1e1a1612ab9 (patch)
treeb33696d408ca10c5b0edd99cad399cc1dd093f52 /src/server
parentb3ea95f3d494c10d3f37de7842982138b4ee19a5 (diff)
fixed login/create templates to point to correct endpoints, updated func names to be more idiomatic, reference Session objects to save memory, logout/session.Destroy method
Diffstat (limited to 'src/server')
-rw-r--r--src/server/router.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/server/router.go b/src/server/router.go
index 6b33a7d..3b43119 100644
--- a/src/server/router.go
+++ b/src/server/router.go
@@ -12,12 +12,11 @@ import (
type HandlerFunc func(s *Server) http.HandlerFunc
type Route struct {
- Name string
- Method string
- Path string
- AuthRequired bool
- HandlerFunc HandlerFunc
- Middlewares []func(http.Handler) http.Handler
+ Name string
+ Method string
+ Path string
+ HandlerFunc HandlerFunc
+ Middlewares []func(http.Handler) http.Handler
}
type Routes []Route
@@ -25,6 +24,7 @@ type Routes []Route
func NewRouter(config *conf.Conf) *chi.Mux {
r := chi.NewRouter()
r.Use(middleware.Logger)
- r.Use(sessions.SetSession)
+ sessions.InitStore()
+ r.Use(sessions.StartSession)
return r
}