The AuthService was not scoped to each incoming request.
This meant that if the server had to process requests from different connected users in parallel (nearly at the same time), the result was unpredictable.
Fortunately, the problem probably never occurred, as the application's traffic remains limited.
The solution
From now on, an instance of the AuthService is created for each incoming request.
This is a critical fix!
The problem
The
AuthService
was not scoped to each incoming request.This meant that if the server had to process requests from different connected users in parallel (nearly at the same time), the result was unpredictable.
Fortunately, the problem probably never occurred, as the application's traffic remains limited.
The solution
From now on, an instance of the
AuthService
is created for each incoming request.Learn more about the implementation of the solution : https://docs.nestjs.com/fundamentals/injection-scopes