chore: redirect user after payment gateway

This commit is contained in:
mahyargdz
2025-02-24 15:20:01 +03:30
parent 3b0120d338
commit d563c254e2
5 changed files with 44 additions and 35 deletions
+3 -2
View File
@@ -1,6 +1,6 @@
import { createHmac } from "node:crypto";
import { BadRequestException, Injectable, Logger } from "@nestjs/common";
import { BadRequestException, HttpStatus, Injectable, Logger } from "@nestjs/common";
import { ConfigService } from "@nestjs/config";
import { FastifyReply } from "fastify";
import slugify from "slugify";
@@ -159,6 +159,7 @@ export class UsersService {
/************************************************************ */
//TODO:fix this later
async verifyEmail(queryDto: EmailVerifyQueryDto, rep: FastifyReply) {
const frontUrl = this.configService.getOrThrow<string>("FRONT_URL");
const { token, userId, ts } = queryDto;
const user = await this.userRepository.findOneBy({ id: userId });
@@ -181,7 +182,7 @@ export class UsersService {
await this.userRepository.save(user);
// return { message: UserMessage.EMAIL_VERIFIED };
return rep.redirect("https://google.com");
return rep.status(HttpStatus.FOUND).redirect(frontUrl);
}
/************************************************************ */