Skip to content

Commit

Permalink
support sending account id within the username field
Browse files Browse the repository at this point in the history
  • Loading branch information
idanasulin2706 committed Sep 10, 2023
1 parent 06c3fc4 commit a653926
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions handlers/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ func (ah AuthHandler) Authenticate(c *fiber.Ctx) error {
accId, err := c.Request().URI().QueryArgs().GetUint("accountId")
if err == nil {
accountId = accId
} else {
splittedUsername := strings.Split(body.Username, "$")
if len(splittedUsername) > 1 {
accountId, _ = strconv.Atoi(splittedUsername[1])
body.Username = splittedUsername[0]
}
}
}

Expand Down

0 comments on commit a653926

Please sign in to comment.