From 50b4dcce56275e57fc15ade7529f5c501cad150d Mon Sep 17 00:00:00 2001 From: Nassim Bounouas Date: Tue, 2 Jul 2019 11:16:33 +0200 Subject: Fix/connection with email (#1917) * #1916 Load user by email - insensitive query * Revert "Case insensitive login" This reverts commit c1521ca3d757bee91f7dfbb15b3717162bf4997d. * #1916 Load user - insensitive query for username and sensitive for email * #1916 Unit test for insensitive username login && documentation --- server/tests/api/users/users.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'server/tests') diff --git a/server/tests/api/users/users.ts b/server/tests/api/users/users.ts index 403d1a089..6fc2a070f 100644 --- a/server/tests/api/users/users.ts +++ b/server/tests/api/users/users.ts @@ -116,6 +116,17 @@ describe('Test users', function () { accessToken = res.body.access_token }) + + it('Should be able to login with an insensitive username', async function () { + const user = { username: 'RoOt', password: server.user.password } + const res = await login(server.url, server.client, user, 200) + + const user2 = { username: 'rOoT', password: server.user.password } + const res2 = await login(server.url, server.client, user2, 200) + + const user3 = { username: 'ROOt', password: server.user.password } + const res3 = await login(server.url, server.client, user3, 200) + }) }) describe('Upload', function () { -- cgit v1.2.3