From e15bf8cd1375f24251929ff3e13f883f692ee03a Mon Sep 17 00:00:00 2001 From: KushBlazingJudah <59340248+KushBlazingJudah@users.noreply.github.com> Date: Tue, 9 Nov 2021 19:37:34 -0400 Subject: slacking off is great; here's part 6 --- routes/util.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'routes/util.go') 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 +} -- cgit v1.2.3