BUG: Draft application update JWT failure is logged as unhandled
- Dominant language
- TypeScript
- Stars
- 29
- Forks
- 15
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 38
Description
**Describe the Bug**
A `PATCH /api/students/application/:id/draft` request fails JWT authentication with a 401 response and is emitted by `AppAllExceptionsFilter` as an unhandled error.
**Expected Behaviour**
Authentication failures are handled as expected client responses and do not generate misleading unhandled-exception error logs.
**Actual Behaviour**
The API returns 401 and records `UnauthorizedException: Unauthorized` as an unhandled exception.
**Log**
```text
[Nest] 18 - 09/04/2026, 8:08:26 AM LOG [AccessLoggerMiddleware] Request - PATCH /api/students/application/[redacted]/draft From [redacted] | User GUID: [redacted] | User Agent: Safari on macOS
[Nest] 18 - 09/04/2026, 8:08:26 AM ERROR [AppAllExceptionsFilter] Unhandled exception, request path: /api/students/application/[redacted]/draft
{
"stack": "UnauthorizedException: Unauthorized\n at JwtAuthGuard.handleRequest (/app/node_modules/@nestjs/passport/dist/auth.guard.js:60:30)",
"response": { "message": "Unauthorized" },
"status": 401,
"message": "Unauthorized",
"name": "UnauthorizedException"
}
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating AppAllExceptionsFilter and the JwtAuthGuard handling for PATCH /api/students/application/:id/draft. Reproduce the failed JWT request and inspect the resulting 401 log. Done means authentication still returns 401 while UnauthorizedException is no longer recorded as an unhandled error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, authentication, backend, security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100