diff options
Diffstat (limited to 'routes')
-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 +} |