From fa886b95fb0f1838c557dc355786578a5d5f1345 Mon Sep 17 00:00:00 2001 From: eccentric Date: Tue, 19 Dec 2023 21:48:01 +0000 Subject: [PATCH] asd --- handlers/auth.go | 6 +++--- main.go | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/handlers/auth.go b/handlers/auth.go index 1148f2d..e7e2906 100644 --- a/handlers/auth.go +++ b/handlers/auth.go @@ -145,7 +145,7 @@ func GetOAuthVerify(c *fiber.Ctx) error { }) } -func FortniteMiddleware(c *fiber.Ctx) error { +func MiddlewareFortnite(c *fiber.Ctx) error { auth := c.Get("Authorization") if auth == "" { return c.Status(fiber.StatusForbidden).JSON(aid.ErrorBadRequest("Authorization Header is empty")) @@ -167,7 +167,7 @@ func FortniteMiddleware(c *fiber.Ctx) error { return c.Next() } -func FrontendMiddleware(c *fiber.Ctx) error { +func MiddlewareWeb(c *fiber.Ctx) error { auth := c.Get("Authorization") if auth == "" { return c.Status(fiber.StatusForbidden).JSON(aid.ErrorBadRequest("Authorization Header is empty")) @@ -188,7 +188,7 @@ func FrontendMiddleware(c *fiber.Ctx) error { return c.Next() } -func DeleteOAuthSessions(c *fiber.Ctx) error { +func DeleteToken(c *fiber.Ctx) error { return c.Status(fiber.StatusOK).JSON(aid.JSON{}) } diff --git a/main.go b/main.go index 5695aea..5d4e2fb 100644 --- a/main.go +++ b/main.go @@ -72,7 +72,7 @@ func main() { account.Get("/public/account/displayName/:displayName", handlers.GetPublicAccountByDisplayName) account.Get("/oauth/verify", handlers.GetOAuthVerify) account.Post("/oauth/token", handlers.PostFortniteToken) - account.Delete("/oauth/sessions/kill", handlers.DeleteOAuthSessions) + account.Delete("/oauth/sessions/kill", handlers.DeleteToken) fortnite := r.Group("/fortnite/api") fortnite.Get("/receipts/v1/account/:accountId/receipts", handlers.GetFortniteReceipts) @@ -80,7 +80,7 @@ func main() { fortnite.Get("/calendar/v1/timeline", handlers.GetFortniteTimeline) storefront := fortnite.Group("/storefront/v2") - storefront.Use(handlers.FortniteMiddleware) + storefront.Use(handlers.MiddlewareFortnite) storefront.Get("/catalog", handlers.GetStorefrontCatalog) storefront.Get("/keychain", handlers.GetStorefrontKeychain) @@ -93,7 +93,7 @@ func main() { storage.Get("/system/:fileName", handlers.GetCloudStorageFile) user := storage.Group("/user") - user.Use(handlers.FortniteMiddleware) + user.Use(handlers.MiddlewareFortnite) user.Get("/:accountId", handlers.GetUserStorageFiles) user.Get("/:accountId/:fileName", handlers.GetUserStorageFile) user.Put("/:accountId/:fileName", handlers.PutUserStorageFile) @@ -106,11 +106,11 @@ func main() { game.Post("/profileToken/verify/:accountId", handlers.AnyNoContent) profile := game.Group("/profile/:accountId") - profile.Use(handlers.FortniteMiddleware) + profile.Use(handlers.MiddlewareFortnite) profile.Post("/client/:action", handlers.PostProfileAction) lightswitch := r.Group("/lightswitch/api") - lightswitch.Use(handlers.FortniteMiddleware) + lightswitch.Use(handlers.MiddlewareFortnite) lightswitch.Get("/service/bulk/status", handlers.GetLightswitchBulkStatus) snow := r.Group("/snow") @@ -121,7 +121,7 @@ func main() { discord.Get("/", handlers.GetDiscordOAuthURL) player := snow.Group("/player") - player.Use(handlers.FrontendMiddleware) + player.Use(handlers.MiddlewareWeb) player.Get("/", handlers.GetPlayer) player.Get("/locker", handlers.GetPlayerLocker)