From 32a5863b251841e9fcb33271fc6c7d449e5e8900 Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Sun, 18 Sep 2022 00:41:14 +0300 Subject: [PATCH] fix api lookup --- internal/api/middleware.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/api/middleware.go b/internal/api/middleware.go index 2800930..290e90c 100644 --- a/internal/api/middleware.go +++ b/internal/api/middleware.go @@ -73,7 +73,7 @@ func AuthorizationMiddleware(database *gorm.DB, authType AuthType, accessType Ac if accessType.Type == "admin" { tx = database.Where("wallet_adminkey = ? COLLATE NOCASE", password).First(user) } else if accessType.Type == "invoice" { - tx = database.Where("wallet_inkey = ? COLLATE NOCASE", password).First(user) + tx = database.Where("wallet_inkey = ? OR wallet_adminkey = ? COLLATE NOCASE", password, password).First(user) } else { log.Errorf("[api] route without access type") w.WriteHeader(401)