aboutsummaryrefslogtreecommitdiff
path: root/routes
diff options
context:
space:
mode:
authorKushBlazingJudah <59340248+KushBlazingJudah@users.noreply.github.com>2021-11-09 19:37:34 -0400
committerFChannel <>2022-06-19 12:53:29 -0700
commite15bf8cd1375f24251929ff3e13f883f692ee03a (patch)
tree661fec8cc005630a67df1fc4c933a1e8a19f686b /routes
parent7116705959bad9244893434039a0da9b500f5043 (diff)
slacking off is great; here's part 6
Diffstat (limited to 'routes')
-rw-r--r--routes/util.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/routes/util.go b/routes/util.go
index 0a8dc9c..3d03795 100644
--- a/routes/util.go
+++ b/routes/util.go
@@ -6,6 +6,7 @@ import (
"strings"
"github.com/FChannel0/FChannel-Server/activitypub"
+ "github.com/FChannel0/FChannel-Server/config"
"github.com/FChannel0/FChannel-Server/db"
"github.com/gofiber/fiber/v2"
)
@@ -113,3 +114,14 @@ func wantToServeArchive(actorName string) (activitypub.Collection, bool, error)
return collection, serve, nil
}
+
+func hasValidation(ctx *fiber.Ctx, actor activitypub.Actor) bool {
+ id, _ := getPassword(ctx)
+
+ if id == "" || (id != actor.Id && id != config.Domain) {
+ //http.Redirect(w, r, "/", http.StatusSeeOther)
+ return false
+ }
+
+ return true
+}