Skip to content

Commit 796b40c

Browse files
Address comments
1 parent 27c602a commit 796b40c

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

api/auth_middleware.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,10 @@ import (
99
"github.com/gofiber/fiber/v2"
1010
)
1111

12-
const (
13-
messageHeader = "Encoded-Data-Message"
14-
signatureHeader = "Encoded-Data-Signature"
15-
)
16-
1712
// Recover user id and wallet from signature headers
1813
func (app *ApiServer) recoverAuthorityFromSignatureHeaders(c *fiber.Ctx) (int32, string) {
19-
message := c.Get(messageHeader)
20-
signature := c.Get(signatureHeader)
14+
message := c.Get("Encoded-Data-Message")
15+
signature := c.Get("Encoded-Data-Signature")
2116
if message == "" || signature == "" {
2217
return 0, ""
2318
}
@@ -46,7 +41,7 @@ func (app *ApiServer) recoverAuthorityFromSignatureHeaders(c *fiber.Ctx) (int32,
4641
WHERE
4742
wallet = $1
4843
AND is_current = true
49-
ORDER BY created_at ASC
44+
ORDER BY handle_lc IS NOT NULL, created_at ASC
5045
LIMIT 1
5146
`,
5247
walletLower,

0 commit comments

Comments
 (0)