Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8a146a2e1d
|
||
|
|
1ab6e1a969
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@memegoat/backend",
|
"name": "@memegoat/backend",
|
||||||
"version": "1.10.0",
|
"version": "1.10.1",
|
||||||
"description": "",
|
"description": "",
|
||||||
"author": "",
|
"author": "",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
@@ -49,9 +49,11 @@ 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)
|
||||||
expect(Sentry.captureException).toHaveBeenCalledWith(exception);
|
expect(Sentry.captureException).toHaveBeenCalledWith(exception);
|
||||||
});
|
});
|
||||||
@@ -79,7 +81,7 @@ describe("AllExceptionsFilter", () => {
|
|||||||
filter.catch(exception, mockArgumentsHost);
|
filter.catch(exception, mockArgumentsHost);
|
||||||
|
|
||||||
expect(mockResponse.status).toHaveBeenCalledWith(HttpStatus.BAD_REQUEST);
|
expect(mockResponse.status).toHaveBeenCalledWith(HttpStatus.BAD_REQUEST);
|
||||||
|
|
||||||
// L'IP 1.2.3.4 hachée en SHA256 contient un hash de 64 caractères
|
// L'IP 1.2.3.4 hachée en SHA256 contient un hash de 64 caractères
|
||||||
const logCall = loggerSpy.mock.calls[0][0];
|
const logCall = loggerSpy.mock.calls[0][0];
|
||||||
expect(logCall).toMatch(/[a-f0-9]{64}/);
|
expect(logCall).toMatch(/[a-f0-9]{64}/);
|
||||||
|
|||||||
@@ -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";
|
||||||
|
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@memegoat/frontend",
|
"name": "@memegoat/frontend",
|
||||||
"version": "1.10.0",
|
"version": "1.10.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@memegoat/source",
|
"name": "@memegoat/source",
|
||||||
"version": "1.10.0",
|
"version": "1.10.1",
|
||||||
"description": "",
|
"description": "",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"version:get": "cmake -P version.cmake GET",
|
"version:get": "cmake -P version.cmake GET",
|
||||||
|
|||||||
Reference in New Issue
Block a user