aboutsummaryrefslogtreecommitdiff
path: root/routes/admin.go
diff options
context:
space:
mode:
authorFChannel <>2022-05-05 10:05:40 -0700
committerFChannel <>2022-06-19 12:53:29 -0700
commitaf542e339e5a611d2a1b5876450bee841b577640 (patch)
tree987f4fce83d49605a0a81d68fcfac9b2d57cf8a7 /routes/admin.go
parent493fc8e025fd613d9faf0b573d610e4a0e0c0228 (diff)
removed redis dependency
Diffstat (limited to 'routes/admin.go')
-rw-r--r--routes/admin.go11
1 files changed, 1 insertions, 10 deletions
diff --git a/routes/admin.go b/routes/admin.go
index 580b4dd..771cda2 100644
--- a/routes/admin.go
+++ b/routes/admin.go
@@ -15,7 +15,6 @@ import (
"github.com/FChannel0/FChannel-Server/util"
"github.com/FChannel0/FChannel-Server/webfinger"
"github.com/gofiber/fiber/v2"
- "github.com/gofrs/uuid"
)
func AdminVerify(ctx *fiber.Ctx) error {
@@ -54,17 +53,9 @@ func AdminVerify(ctx *fiber.Ctx) error {
return ctx.Redirect("/"+config.Key, http.StatusPermanentRedirect)
}
- //TODO remove redis dependency
- sessionToken, _ := uuid.NewV4()
-
- _, err = db.Cache.Do("SETEX", sessionToken, "86400", body+"|"+verify.Code)
- if err != nil {
- return ctx.Redirect("/"+config.Key, http.StatusPermanentRedirect)
- }
-
ctx.Cookie(&fiber.Cookie{
Name: "session_token",
- Value: sessionToken.String(),
+ Value: body + "|" + verify.Code,
Expires: time.Now().UTC().Add(60 * 60 * 48 * time.Second),
})