1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-03 09:49:20 +02:00

feat(API): permissive email check in login, reset & verification (#6648)

* feat(API): permissive email check in reset & verification

In order to not force users to be case sensitive when asking for
password reset or resend email verification. When there's multiple
emails where the only difference in the local is the capitalized
letters, in those cases the users has to be case sensitive.

closes #6570

* feat(API/login): permissive email handling

Allow case insensitive email when there's no other candidate.

closes #6570

* code review changes

* Fix tests

* Add more duplicate email checks

---------

Co-authored-by: Chocobozzz <me@florianbigard.com>
This commit is contained in:
kontrollanten 2025-01-28 14:16:43 +01:00 committed by GitHub
parent 9f64909fc7
commit a51fb3f35e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 247 additions and 92 deletions

View file

@ -161,6 +161,7 @@ export class UsersCommand extends AbstractCommand {
videoQuotaDaily?: number
role?: UserRoleType
adminFlags?: UserAdminFlagType
email?: string
}) {
const {
username,
@ -168,7 +169,8 @@ export class UsersCommand extends AbstractCommand {
password = 'password',
videoQuota,
videoQuotaDaily,
role = UserRole.USER
role = UserRole.USER,
email = username + '@example.com'
} = options
const path = '/api/v1/users'
@ -182,7 +184,7 @@ export class UsersCommand extends AbstractCommand {
password,
role,
adminFlags,
email: username + '@example.com',
email,
videoQuota,
videoQuotaDaily
},