mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
feat: wip email confirmation
This commit is contained in:
@@ -11,6 +11,7 @@ import { AuthSendResetPassword } from './AuthSendResetPassword';
|
||||
import { GetAuthMeta } from './GetAuthMeta';
|
||||
import { AuthSignupConfirmService } from './AuthSignupConfirm';
|
||||
import { SystemUser } from '@/system/models';
|
||||
import { AuthSignupConfirmResend } from './AuthSignupResend';
|
||||
|
||||
interface ISignupConfirmDTO {
|
||||
token: string;
|
||||
@@ -28,6 +29,9 @@ export default class AuthenticationApplication {
|
||||
@Inject()
|
||||
private authSignupConfirmService: AuthSignupConfirmService;
|
||||
|
||||
@Inject()
|
||||
private authSignUpConfirmResendService: AuthSignupConfirmResend;
|
||||
|
||||
@Inject()
|
||||
private authResetPasswordService: AuthSendResetPassword;
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user