Skip to content

Commit 64b2275

Browse files
committed
fix auth middleware: case insensative wallet compare
1 parent 0552250 commit 64b2275

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

api/auth_middleware.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,14 @@ func (app *ApiServer) requireAuthMiddleware(c *fiber.Ctx) error {
122122
return c.Next()
123123
}
124124

125-
if wallet != "" && wallet == authedWallet {
125+
if wallet != "" && strings.EqualFold(wallet, authedWallet) {
126126
return c.Next()
127127
}
128128

129129
if app.isAuthorizedRequest(c, myId, authedWallet) {
130130
return c.Next()
131131
}
132132

133-
return fiber.NewError(fiber.StatusForbidden, "You are not authorized to make this request")
133+
msg := fmt.Sprintf("You are not authorized to make this request authedUserId=%d authedWallet=%s myId=%d wallet=%s", authedUserId, authedWallet, myId, wallet)
134+
return fiber.NewError(fiber.StatusForbidden, msg)
134135
}

0 commit comments

Comments
 (0)