summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/gotosocial/action/server/server.go23
-rw-r--r--cmd/gotosocial/action/testrig/testrig.go23
2 files changed, 26 insertions, 20 deletions
diff --git a/cmd/gotosocial/action/server/server.go b/cmd/gotosocial/action/server/server.go
index ad9ef851e..aa04f1f12 100644
--- a/cmd/gotosocial/action/server/server.go
+++ b/cmd/gotosocial/action/server/server.go
@@ -478,17 +478,20 @@ var Start action.GTSAction = func(ctx context.Context) error {
return fmt.Errorf("error generating session name for session middleware: %w", err)
}
+ // Configure our instance cookie policy.
+ cookiePolicy := apiutil.NewCookiePolicy()
+
var (
- authModule = api.NewAuth(state, process, idp, routerSession, sessionName) // auth/oauth paths
- clientModule = api.NewClient(state, process) // api client endpoints
- metricsModule = api.NewMetrics() // Metrics endpoints
- healthModule = api.NewHealth(dbService.Ready) // Health check endpoints
- fileserverModule = api.NewFileserver(process) // fileserver endpoints
- robotsModule = api.NewRobots() // robots.txt endpoint
- wellKnownModule = api.NewWellKnown(process) // .well-known endpoints
- nodeInfoModule = api.NewNodeInfo(process) // nodeinfo endpoint
- activityPubModule = api.NewActivityPub(dbService, process) // ActivityPub endpoints
- webModule = web.New(dbService, process) // web pages + user profiles + settings panels etc
+ authModule = api.NewAuth(state, process, idp, routerSession, sessionName, cookiePolicy) // auth/oauth paths
+ clientModule = api.NewClient(state, process) // api client endpoints
+ metricsModule = api.NewMetrics() // Metrics endpoints
+ healthModule = api.NewHealth(dbService.Ready) // Health check endpoints
+ fileserverModule = api.NewFileserver(process) // fileserver endpoints
+ robotsModule = api.NewRobots() // robots.txt endpoint
+ wellKnownModule = api.NewWellKnown(process) // .well-known endpoints
+ nodeInfoModule = api.NewNodeInfo(process) // nodeinfo endpoint
+ activityPubModule = api.NewActivityPub(dbService, process) // ActivityPub endpoints
+ webModule = web.New(dbService, process, cookiePolicy) // web pages + user profiles + settings panels etc
)
// Create per-route / per-grouping middlewares.
diff --git a/cmd/gotosocial/action/testrig/testrig.go b/cmd/gotosocial/action/testrig/testrig.go
index e96e57b97..89e00521f 100644
--- a/cmd/gotosocial/action/testrig/testrig.go
+++ b/cmd/gotosocial/action/testrig/testrig.go
@@ -244,17 +244,20 @@ var Start action.GTSAction = func(ctx context.Context) error {
return fmt.Errorf("error generating session name for session middleware: %w", err)
}
+ // Configure our instance cookie policy.
+ cookiePolicy := apiutil.NewCookiePolicy()
+
var (
- authModule = api.NewAuth(state, processor, idp, routerSession, sessionName) // auth/oauth paths
- clientModule = api.NewClient(state, processor) // api client endpoints
- metricsModule = api.NewMetrics() // Metrics endpoints
- healthModule = api.NewHealth(state.DB.Ready) // Health check endpoints
- fileserverModule = api.NewFileserver(processor) // fileserver endpoints
- robotsModule = api.NewRobots() // robots.txt endpoint
- wellKnownModule = api.NewWellKnown(processor) // .well-known endpoints
- nodeInfoModule = api.NewNodeInfo(processor) // nodeinfo endpoint
- activityPubModule = api.NewActivityPub(state.DB, processor) // ActivityPub endpoints
- webModule = web.New(state.DB, processor) // web pages + user profiles + settings panels etc
+ authModule = api.NewAuth(state, processor, idp, routerSession, sessionName, cookiePolicy) // auth/oauth paths
+ clientModule = api.NewClient(state, processor) // api client endpoints
+ metricsModule = api.NewMetrics() // Metrics endpoints
+ healthModule = api.NewHealth(state.DB.Ready) // Health check endpoints
+ fileserverModule = api.NewFileserver(processor) // fileserver endpoints
+ robotsModule = api.NewRobots() // robots.txt endpoint
+ wellKnownModule = api.NewWellKnown(processor) // .well-known endpoints
+ nodeInfoModule = api.NewNodeInfo(processor) // nodeinfo endpoint
+ activityPubModule = api.NewActivityPub(state.DB, processor) // ActivityPub endpoints
+ webModule = web.New(state.DB, processor, cookiePolicy) // web pages + user profiles + settings panels etc
)
// these should be routed in order