Skip to content

Commit a653926

Browse files
support sending account id within the username field
1 parent 06c3fc4 commit a653926

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

handlers/auth.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ func (ah AuthHandler) Authenticate(c *fiber.Ctx) error {
8383
accId, err := c.Request().URI().QueryArgs().GetUint("accountId")
8484
if err == nil {
8585
accountId = accId
86+
} else {
87+
splittedUsername := strings.Split(body.Username, "$")
88+
if len(splittedUsername) > 1 {
89+
accountId, _ = strconv.Atoi(splittedUsername[1])
90+
body.Username = splittedUsername[0]
91+
}
8692
}
8793
}
8894

0 commit comments

Comments
 (0)