Skip to content

Commit

Permalink
fix: verify-email test
Browse files Browse the repository at this point in the history
  • Loading branch information
saisilinus committed Apr 5, 2022
1 parent 50ed723 commit bf40918
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/components/auth/auth.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import catchAsync from '../../utils/catchAsync';
import { registerUser } from '../user/user.service';
import { generateAuthTokens, generateResetPasswordToken, generateVerifyEmailToken } from '../token/token.service';
import { loginUserWithEmailAndPassword, logout, refreshAuth, resetPassword, verifyEmail } from './auth.service';
import { sendAccountCreated, sendResetPasswordEmail, sendVerificationEmail } from '../email/email.service';
import { sendResetPasswordEmail, sendVerificationEmail } from '../email/email.service';
import config from '../../config/config';
import { AccessAndRefreshTokens } from '../token/token.interfaces';

Expand Down Expand Up @@ -54,9 +54,6 @@ export const sendVerificationEmailController = catchAsync(async (req: Request, r
});

export const verifyEmailController = catchAsync(async (req: Request, res: Response) => {
const user = await verifyEmail(req.query['token']);
if (user) {
await sendAccountCreated(user.email, user.name);
}
await verifyEmail(req.query['token']);
res.status(httpStatus.NO_CONTENT).send();
});

0 comments on commit bf40918

Please sign in to comment.