M3: console.log -> Logger + UI redesign (QuestionBank) + S7/A9/A10/A11/U11 bug fixes + #1/#2/#3/#4 enhancements + i18n for QuestionBank pages

This commit is contained in:
Developer
2026-05-19 16:57:45 +08:00
parent 5b5f14674d
commit 29bac74b58
20 changed files with 1081 additions and 501 deletions
+5 -2
View File
@@ -3,6 +3,7 @@ import {
CanActivate,
ExecutionContext,
UnauthorizedException,
Logger,
} from '@nestjs/common';
import { Reflector } from '@nestjs/core';
import { AuthGuard } from '@nestjs/passport';
@@ -25,6 +26,8 @@ import * as path from 'path';
*/
@Injectable()
export class CombinedAuthGuard implements CanActivate {
private readonly logger = new Logger(CombinedAuthGuard.name);
// We extend AuthGuard('jwt') functionality by composition
private jwtGuard: ReturnType<typeof AuthGuard>;
@@ -55,7 +58,7 @@ export class CombinedAuthGuard implements CanActivate {
return true;
}
console.log(
this.logger.log(
`[CombinedAuthGuard] Checking auth for route: ${request.method} ${request.url}`,
);
@@ -160,7 +163,7 @@ export class CombinedAuthGuard implements CanActivate {
}
return false;
} catch (e) {
console.error(`[CombinedAuthGuard] JWT Auth Error:`, e);
this.logger.error('[CombinedAuthGuard] JWT Auth Error: ' + e);
throw e instanceof UnauthorizedException
? e
: new UnauthorizedException('Authentication required');