Do not force username to always be lowercase in the DB

This commit is contained in:
Deluan
2020-09-01 18:00:19 -04:00
parent 95eea0e9f8
commit 596a4897a3
5 changed files with 9 additions and 8 deletions
+3 -1
View File
@@ -282,7 +282,9 @@ var _ = Describe("Middlewares", func() {
})
It("fails if JWT token sub is different than username", func() {
_, err := validateUser(context.TODO(), ds, "not_admin", "", "", "", validToken)
u := &model.User{UserName: "hacker"}
validToken, _ = auth.CreateToken(u)
_, err := validateUser(context.TODO(), ds, "admin", "", "", "", validToken)
Expect(err).To(MatchError(model.ErrInvalidAuth))
})
})