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:
parent
e19ee1ebc9
commit
986e71a1f7
29 changed files with 426 additions and 271 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue