mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
refactor(nestjs): replace the reports endpoints
This commit is contained in:
@@ -68,6 +68,7 @@ export class AuthController {
|
||||
return this.authApp.signUpConfirm(email, token);
|
||||
}
|
||||
|
||||
|
||||
@Post('/send_reset_password')
|
||||
@ApiOperation({ summary: 'Send reset password email' })
|
||||
@ApiBody({
|
||||
|
||||
@@ -16,10 +16,9 @@ export class AuthedController {
|
||||
constructor(
|
||||
private readonly getAuthedAccountService: GetAuthenticatedAccount,
|
||||
private readonly authApp: AuthenticationApplication,
|
||||
private readonly tenancyContext: TenancyContext,
|
||||
) {}
|
||||
|
||||
@Post('/signup/confirm/resend')
|
||||
@Post('/signup/verify/resend')
|
||||
@ApiOperation({ summary: 'Resend the signup confirmation message' })
|
||||
@ApiBody({
|
||||
schema: {
|
||||
|
||||
@@ -92,7 +92,10 @@ export class AuthSignupService {
|
||||
const isEmailExists = await this.systemUserModel.query().findOne({ email });
|
||||
|
||||
if (isEmailExists) {
|
||||
throw new ServiceError(ERRORS.EMAIL_EXISTS);
|
||||
throw new ServiceError(
|
||||
ERRORS.EMAIL_EXISTS,
|
||||
'The given email address is already signed-up',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,11 +123,17 @@ export class AuthSignupService {
|
||||
);
|
||||
|
||||
if (!isAllowedEmail && !isAllowedDomain) {
|
||||
throw new ServiceError(ERRORS.SIGNUP_RESTRICTED_NOT_ALLOWED);
|
||||
throw new ServiceError(
|
||||
ERRORS.SIGNUP_RESTRICTED_NOT_ALLOWED,
|
||||
'The given email address format is not allowed to signup.',
|
||||
);
|
||||
}
|
||||
// Throw error if the signup is disabled with no exceptions.
|
||||
} else {
|
||||
throw new ServiceError(ERRORS.SIGNUP_RESTRICTED);
|
||||
throw new ServiceError(
|
||||
ERRORS.SIGNUP_RESTRICTED,
|
||||
'The sign-up is disabled',
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user