fix: will now better log for login problems#2204
Open
bosbaber wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves observability for login and API error scenarios by adding additional logging in the wallet frontend HTTP client error helper and the wallet backend authentication flow.
Changes:
- Added
console.errorlogging in the wallet frontendgetErrorhelper when API requests fail. - Added
logger.infomessages in the wallet backendAuthService.authorizemethod for rejected login cases.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| packages/wallet/frontend/src/lib/httpClient.ts | Adds client/server-side error logs for failed HTTP requests and unexpected error response shapes. |
| packages/wallet/backend/src/auth/service.ts | Logs the reason for rejected login attempts during authorization. |
Comment on lines
+80
to
+82
| console.error( | ||
| `[httpClient] ${e.request.method} ${e.response.status} ${e.request.url}: ${response.message}` | ||
| ) |
Comment on lines
+85
to
+88
| console.error( | ||
| `[httpClient] ${e.request.method} ${e.response.status} ${e.request.url}: unexpected error shape`, | ||
| response | ||
| ) |
Comment on lines
+98
to
99
| this.logger.info(`Login rejected: no account found for ${args.email}`) | ||
| throw new Unauthorized('Invalid credentials.') |
Comment on lines
+104
to
105
| this.logger.info(`Login rejected: invalid password for ${args.email}`) | ||
| throw new Unauthorized('Invalid credentials.') |
Comment on lines
+109
to
110
| this.logger.info(`Login rejected: email not verified for ${args.email}`) | ||
| throw new NotVerified('Email address is not verified.') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
At the moment we are only having deafening silence when login fails.
This PR aims to change that.