test: comprehensive test suites and quality gates pass across backend, storefront and admin
- Backend (NestJS): 82 suites, 641 tests passing; 0 ESLint errors; 0 tsc errors. Hardened SSL cert/key matching, SSRF IP pinning, and eBank validation. - Admin Panel (Vite/React): 48 suites, 300 tests passing; 0 ESLint errors; 0 tsc errors. Full coverage across all pages and settings. - Storefront (Next.js): 62 suites, 368 tests passing; 0 ESLint errors; 0 tsc errors. - Fixed unmount lifecycle guards, promise error handling, and component edge cases.
This commit is contained in:
1 parent
1e73715169
commit
ddbf1ca026
439 files changed
+32911
-6107
No files matched your search
@@ -1,11 +1,11 @@
|
||||
import { ExtractJwt, Strategy } from 'passport-jwt';
|
||||
import { PassportStrategy } from '@nestjs/passport';
|
||||
import { Injectable, UnauthorizedException } from '@nestjs/common';
|
||||
import { UsersService } from '../users/users.service';
|
||||
import { getJwtSecret } from './auth.constants';
|
||||
import { ExtractJwt, Strategy } from "passport-jwt";
|
||||
import { PassportStrategy } from "@nestjs/passport";
|
||||
import { Injectable, UnauthorizedException } from "@nestjs/common";
|
||||
import { UsersService } from "../users/users.service";
|
||||
import { getJwtSecret } from "./auth.constants";
|
||||
|
||||
import { RedisService } from '../redis/redis.service';
|
||||
import type { Request } from 'express';
|
||||
import { RedisService } from "../redis/redis.service";
|
||||
import type { Request } from "express";
|
||||
|
||||
export interface JwtPayload {
|
||||
sub: string;
|
||||
@@ -50,14 +50,14 @@ export class JwtStrategy extends PassportStrategy(Strategy) {
|
||||
const isBlacklisted = await this.redisService.get(`bl_token:${rawToken}`);
|
||||
if (isBlacklisted) {
|
||||
throw new UnauthorizedException(
|
||||
'این توکن باطل شده است. لطفاً مجدداً وارد شوید',
|
||||
"این توکن باطل شده است. لطفاً مجدداً وارد شوید",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const user = await this.usersService.findById(payload.sub);
|
||||
if (!user) {
|
||||
throw new UnauthorizedException('کاربر یافت نشد');
|
||||
throw new UnauthorizedException("کاربر یافت نشد");
|
||||
}
|
||||
return user;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user