From 408700367b6a56b787297fc22ecd8bb0c8e93b64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Z=C3=BCrcher?= Date: Tue, 29 Apr 2025 08:32:23 +0200 Subject: [PATCH] implement id over url query --- auth/auth.go | 8 ++++++++ server/server.go | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/auth/auth.go b/auth/auth.go index fc47c39..6cf5cd3 100644 --- a/auth/auth.go +++ b/auth/auth.go @@ -13,3 +13,11 @@ func GetIDFromAuth(c *gin.Context) (string, error) { } return "", errors.New("authorization token missing") } + +func GetIDFromQuery(c *gin.Context) (string, error) { + auth, exists := c.GetQuery("id") + if !exists { + return "", errors.New("id missing") + } + return auth, nil +} diff --git a/server/server.go b/server/server.go index 7afe4f5..cfd7f05 100644 --- a/server/server.go +++ b/server/server.go @@ -5,8 +5,8 @@ import ( "sync" "github.com/gin-gonic/gin" + "github.com/tecamino/tecamino-dbm/cert" "github.com/tecamino/tecamino-logger/logging" - "github.com/zuadi/tecamino-dbm/cert" ) type Server struct {