summaryrefslogtreecommitdiff
path: root/internal/api/server.go
diff options
context:
space:
mode:
authorLibravatar tsmethurst <tobi.smethurst@protonmail.com>2021-03-17 13:14:52 +0100
committerLibravatar tsmethurst <tobi.smethurst@protonmail.com>2021-03-17 13:14:52 +0100
commit9d5fb0785f80fddd3b4193aae25c4b1ee96eb7fa (patch)
treefb985438cdf2a3208146a67f1aec221b908038bb /internal/api/server.go
parentSome more messing around with oauth2 (diff)
downloadgotosocial-9d5fb0785f80fddd3b4193aae25c4b1ee96eb7fa.tar.xz
fiddling
Diffstat (limited to 'internal/api/server.go')
-rw-r--r--internal/api/server.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/internal/api/server.go b/internal/api/server.go
index 9073618f0..0cfe23531 100644
--- a/internal/api/server.go
+++ b/internal/api/server.go
@@ -19,6 +19,8 @@
package api
import (
+ "github.com/gin-contrib/sessions"
+ "github.com/gin-contrib/sessions/memstore"
"github.com/gin-gonic/gin"
"github.com/gotosocial/gotosocial/internal/config"
"github.com/sirupsen/logrus"
@@ -67,6 +69,8 @@ func (s *server) AttachHandler(method string, path string, handler gin.HandlerFu
func New(config *config.Config, logger *logrus.Logger) Server {
engine := gin.New()
+ store := memstore.NewStore([]byte("authentication-key"), []byte("encryption-key"))
+ engine.Use(sessions.Sessions("mysession", store))
return &server{
APIGroup: engine.Group("/api").Group("/v1"),
logger: logger,