feat: configure session store options for API routes
- Set session cookie path to "/api" - Disable secure flag for local development - Enable HttpOnly flag for improved security
This commit is contained in:
5
main.go
5
main.go
@@ -145,6 +145,11 @@ func main() {
|
||||
middleware.SetUpLogger(server)
|
||||
// Initialize session store
|
||||
store := cookie.NewStore([]byte(common.SessionSecret))
|
||||
store.Options(sessions.Options{
|
||||
Path: "/api",
|
||||
Secure: false,
|
||||
HttpOnly: true,
|
||||
})
|
||||
server.Use(sessions.Sessions("session", store))
|
||||
|
||||
router.SetRouter(server, buildFS, indexPage)
|
||||
|
||||
Reference in New Issue
Block a user