Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

Bugfix/exception handling in user authorization (#4015)

Thomas Kaula1fbdc2ebea3
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5fff96a3e5..f675e03dff 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## Unreleased
+
+### Fixed
+
+- Improved the exception handling in the user authorization service
+
## 2.121.1 - 2024-11-02
### Added
diff --git a/apps/api/src/app/auth/jwt.strategy.ts b/apps/api/src/app/auth/jwt.strategy.ts
index 1200ed4659..7a3fb224b6 100644
--- a/apps/api/src/app/auth/jwt.strategy.ts
+++ b/apps/api/src/app/auth/jwt.strategy.ts
@@ -60,7 +60,7 @@ export class JwtStrategy extends PassportStrategy(Strategy, 'jwt') {
);
}
} catch (error) {
- if (error?.getStatus() === StatusCodes.TOO_MANY_REQUESTS) {
+ if (error?.getStatus?.() === StatusCodes.TOO_MANY_REQUESTS) {
throw error;
} else {
throw new HttpException(