feat: wip email confirmation

This commit is contained in:
Ahmed Bouhuolia
2024-04-28 17:51:11 +02:00
parent 4368c18479
commit b9fc0cdd9e
15 changed files with 283 additions and 36 deletions

View File

@@ -13,14 +13,12 @@ export class AuthSignupConfirmResend {
* @param {number} tenantId
* @param {string} email
*/
public async signUpConfirmResend(email: string) {
const user = await SystemUser.query()
.findOne({ email })
.throwIfNotFound();
public async signUpConfirmResend(userId: number) {
const user = await SystemUser.query().findById(userId).throwIfNotFound();
//
//
if (user.verified) {
throw new ServiceError(ERRORS.USER_ALREADY_VERIFIED)
throw new ServiceError(ERRORS.USER_ALREADY_VERIFIED);
}
if (user.verifyToken) {
throw new ServiceError(ERRORS.USER_ALREADY_VERIFIED);