refactor: adjust imports and streamline code for consistency

- Reorganized import statements in multiple files for better readability.
- Refined `auth.service` to remove unused `email` variable in `login` function.
- Cleaned up whitespace and formatting in `http-exception.filter.spec.ts`.
This commit is contained in:
Mathis HERRIOT
2026-02-09 11:45:12 +01:00
parent e27a98ca89
commit 1ab6e1a969
4 changed files with 8 additions and 6 deletions

View File

@@ -105,7 +105,7 @@ export class AuthService {
async login(dto: LoginDto, userAgent?: string, ip?: string) { async login(dto: LoginDto, userAgent?: string, ip?: string) {
const emailHash = await this.hashingService.hashEmail(dto.email); const emailHash = await this.hashingService.hashEmail(dto.email);
this.logger.log(`Login attempt for email hash: ${emailHash}`); this.logger.log(`Login attempt for email hash: ${emailHash}`);
const { email, password } = dto; const { password } = dto;
const user = await this.usersService.findByEmailHash(emailHash); const user = await this.usersService.findByEmailHash(emailHash);
if (!user) { if (!user) {

View File

@@ -49,7 +49,9 @@ describe("AllExceptionsFilter", () => {
filter.catch(exception, mockArgumentsHost); filter.catch(exception, mockArgumentsHost);
expect(mockResponse.status).toHaveBeenCalledWith(HttpStatus.INTERNAL_SERVER_ERROR); expect(mockResponse.status).toHaveBeenCalledWith(
HttpStatus.INTERNAL_SERVER_ERROR,
);
expect(Sentry.withScope).toHaveBeenCalled(); expect(Sentry.withScope).toHaveBeenCalled();
// Vérifier que captureException a été appelé (via withScope) // Vérifier que captureException a été appelé (via withScope)

View File

@@ -1,3 +1,4 @@
import { createHash } from "node:crypto";
import { import {
ArgumentsHost, ArgumentsHost,
Catch, Catch,
@@ -6,7 +7,6 @@ import {
HttpStatus, HttpStatus,
Logger, Logger,
} from "@nestjs/common"; } from "@nestjs/common";
import { createHash } from "node:crypto";
import * as Sentry from "@sentry/nestjs"; import * as Sentry from "@sentry/nestjs";
import { Request, Response } from "express"; import { Request, Response } from "express";

View File

@@ -1,7 +1,7 @@
import { createHash } from "node:crypto";
import { CACHE_MANAGER } from "@nestjs/cache-manager"; import { CACHE_MANAGER } from "@nestjs/cache-manager";
import { Inject, Injectable, Logger, NestMiddleware } from "@nestjs/common"; import { Inject, Injectable, Logger, NestMiddleware } from "@nestjs/common";
import type { Cache } from "cache-manager"; import type { Cache } from "cache-manager";
import { createHash } from "node:crypto";
import type { NextFunction, Request, Response } from "express"; import type { NextFunction, Request, Response } from "express";
@Injectable() @Injectable()