diff options
author | KushBlazingJudah <59340248+KushBlazingJudah@users.noreply.github.com> | 2021-11-09 19:37:34 -0400 |
---|---|---|
committer | FChannel <> | 2022-06-19 12:53:29 -0700 |
commit | e15bf8cd1375f24251929ff3e13f883f692ee03a (patch) | |
tree | 661fec8cc005630a67df1fc4c933a1e8a19f686b /routes/util.go | |
parent | 7116705959bad9244893434039a0da9b500f5043 (diff) |
slacking off is great; here's part 6
Diffstat (limited to 'routes/util.go')
-rw-r--r-- | routes/util.go | 12 |
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 +} |