diff options
author | Nassim Bounouas <NassimBounouas@users.noreply.github.com> | 2019-07-02 11:16:33 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-07-02 11:16:33 +0200 |
commit | 50b4dcce56275e57fc15ade7529f5c501cad150d (patch) | |
tree | e46c0faa68eb92f964dad01df83b0126a7e9077e /server/models/account/user.ts | |
parent | c1109b45f6d6ed8024908df2340f8c06ae4c5db7 (diff) | |
download | PeerTube-50b4dcce56275e57fc15ade7529f5c501cad150d.tar.gz PeerTube-50b4dcce56275e57fc15ade7529f5c501cad150d.tar.zst PeerTube-50b4dcce56275e57fc15ade7529f5c501cad150d.zip |
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
Diffstat (limited to 'server/models/account/user.ts')
-rw-r--r-- | server/models/account/user.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/models/account/user.ts b/server/models/account/user.ts index aac691d66..0f425bb82 100644 --- a/server/models/account/user.ts +++ b/server/models/account/user.ts | |||
@@ -367,7 +367,7 @@ export class UserModel extends Model<UserModel> { | |||
367 | static loadByUsername (username: string) { | 367 | static loadByUsername (username: string) { |
368 | const query = { | 368 | const query = { |
369 | where: { | 369 | where: { |
370 | username | 370 | username: { [ Op.iLike ]: username } |
371 | } | 371 | } |
372 | } | 372 | } |
373 | 373 | ||
@@ -377,7 +377,7 @@ export class UserModel extends Model<UserModel> { | |||
377 | static loadByUsernameAndPopulateChannels (username: string) { | 377 | static loadByUsernameAndPopulateChannels (username: string) { |
378 | const query = { | 378 | const query = { |
379 | where: { | 379 | where: { |
380 | username | 380 | username: { [ Op.iLike ]: username } |
381 | } | 381 | } |
382 | } | 382 | } |
383 | 383 | ||
@@ -399,7 +399,7 @@ export class UserModel extends Model<UserModel> { | |||
399 | 399 | ||
400 | const query = { | 400 | const query = { |
401 | where: { | 401 | where: { |
402 | [ Op.or ]: [ { username }, { email } ] | 402 | [ Op.or ]: [ { username: { [ Op.iLike ]: username } }, { email } ] |
403 | } | 403 | } |
404 | } | 404 | } |
405 | 405 | ||