1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-06 03:50:26 +02:00

Better ask email verification flow

Allow user to resend the email verification link when changing the
current email
Fix success messages when validating a new email
This commit is contained in:
Chocobozzz 2025-04-15 09:19:12 +02:00
parent e19ee1ebc9
commit 986e71a1f7
No known key found for this signature in database
GPG key ID: 583A612D890159BE
29 changed files with 426 additions and 271 deletions

View file

@ -1,6 +1,6 @@
import { forceNumber } from '@peertube/peertube-core-utils'
import { HttpStatusCode, UserRightType } from '@peertube/peertube-models'
import { getUserByEmailPermissive } from '@server/lib/user.js'
import { getByEmailPermissive } from '@server/lib/user.js'
import { ActorModel } from '@server/models/actor/actor.js'
import { UserModel } from '@server/models/user/user.js'
import { MAccountId, MUserAccountId, MUserDefault } from '@server/types/models/index.js'
@ -16,7 +16,19 @@ export function checkUserEmailExistPermissive (email: string, res: express.Respo
async () => {
const users = await UserModel.loadByEmailCaseInsensitive(email)
return getUserByEmailPermissive(users, email)
return getByEmailPermissive(users, email)
},
res,
abortResponse
)
}
export function checkUserPendingEmailExistPermissive (email: string, res: express.Response, abortResponse = true) {
return checkUserExist(
async () => {
const users = await UserModel.loadByPendingEmailCaseInsensitive(email)
return getByEmailPermissive(users, email)
},
res,
abortResponse