Added Joi for schema validation, tidied up envs

This commit is contained in:
SepehrYahyaee
2026-05-30 10:37:23 +03:30
parent 10df869efb
commit 6ac0bf060e
12 changed files with 176 additions and 59 deletions

View File

@@ -75,7 +75,7 @@ export class UserAuthService {
role: "user",
};
const accToken = this.jwtService.sign(payload, {
secret: `${process.env.SECRET}`,
secret: `${process.env.JWT_SECRET}`,
});
await this.userDbService.findOneAndUpdate(
{ username: user.username },
@@ -162,10 +162,7 @@ export class UserAuthService {
process.env.AUTH_SMS_TEMPLATE,
);
if (!ok) {
throw new HttpException(
"auth sms send failed",
HttpStatus.BAD_GATEWAY,
);
throw new HttpException("auth sms send failed", HttpStatus.BAD_GATEWAY);
}
this.logger.log(
`Auth OTP SMS accepted by provider phone=${mobile} otp=${otp}`,