diff options
-rw-r--r-- | main.go | 4 | ||||
-rw-r--r-- | route/routes/admin.go | 6 | ||||
-rw-r--r-- | views/verify.html | 8 |
3 files changed, 9 insertions, 9 deletions
@@ -60,9 +60,9 @@ func main() { app.Get("/followers", routes.Followers) // Admin routes - app.Post("/verify", routes.AdminVerify) - app.Post("/auth", routes.AdminAuth) app.All("/"+config.Key+"/", routes.AdminIndex) + app.Post("/"+config.Key+"/verify", routes.AdminVerify) + app.Post("/"+config.Key+"/auth", routes.AdminAuth) app.Get("/"+config.Key+"/follow", routes.AdminFollow) app.Post("/"+config.Key+"/addboard", routes.AdminAddBoard) app.Post("/"+config.Key+"/newspost", routes.NewsPost) diff --git a/route/routes/admin.go b/route/routes/admin.go index 0b05fbf..1deff55 100644 --- a/route/routes/admin.go +++ b/route/routes/admin.go @@ -29,7 +29,7 @@ func AdminVerify(ctx *fiber.Ctx) error { j, _ := json.Marshal(&verify) - req, err := http.NewRequest("POST", config.Domain+"/auth", bytes.NewBuffer(j)) + req, err := http.NewRequest("POST", config.Domain+"/"+config.Key+"/auth", bytes.NewBuffer(j)) if err != nil { return util.MakeError(err, "AdminVerify") @@ -94,7 +94,7 @@ func AdminIndex(ctx *fiber.Ctx) error { } if id == "" || (id != actor.Id && id != config.Domain) { - return ctx.Render("verify", fiber.Map{}) + return ctx.Render("verify", fiber.Map{"key": config.Key}) } actor, err := activitypub.GetActor(config.Domain) @@ -252,7 +252,7 @@ func AdminActorIndex(ctx *fiber.Ctx) error { hasAuth, data.Board.ModCred = util.HasAuth(pass, actor.Id) if !hasAuth || (id != actor.Id && id != config.Domain) { - return ctx.Render("verify", fiber.Map{}) + return ctx.Render("verify", fiber.Map{"key": config.Key}) } reqActivity := activitypub.Activity{Id: actor.Following} diff --git a/views/verify.html b/views/verify.html index fb3fb3d..767b296 100644 --- a/views/verify.html +++ b/views/verify.html @@ -1,16 +1,16 @@ <!DOCTYPE html> <html> - <meta name="viewport" content="width=device-width, initial-scale=1"> + <meta name="viewport" content="width=device-width, initial-scale=1"> <head> </head> <body> <div style="width: 200px; margin: 0 auto;"> - <form action="/verify" method="post"> + <form action="/{{ .key }}/verify" method="post"> <label>Identifier</label> <input type="text" id="identifier" name="id" required><br> - <label>Code</label> + <label>Code</label> <input type="text" id="verify" name="code" required><br> - <input type="submit" value="Verify"> + <input type="submit" value="Verify"> </form> </div> </body> |