From 1471c87886c4ae53f8b09022786521a67d5e6857 Mon Sep 17 00:00:00 2001 From: alikhanich Date: Fri, 17 Mar 2023 09:23:42 +0300 Subject: [PATCH] fix --- handler/session.go | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/handler/session.go b/handler/session.go index fb2c634..f932e82 100644 --- a/handler/session.go +++ b/handler/session.go @@ -23,22 +23,6 @@ func ValidSession(next echo.HandlerFunc) echo.HandlerFunc { } } -func ProtectedHandler(next echo.HandlerFunc) echo.HandlerFunc { - return func(c echo.Context) error { - sess, err := session.Get("session", c) - if err != nil { - return err - } - - apiKey, ok := sess.Values["api_key"].(string) - if !ok || apiKey != util.ApiKey { - return echo.NewHTTPError(http.StatusUnauthorized, "Invalid API key") - } - // Handle the request for authenticated users - return next(c) - } -} - func isValidSession(c echo.Context) bool { if util.DisableLogin { return true