Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(core,console): update error handling of testing custom JWT #5611

Merged

Conversation

darcyYe
Copy link
Contributor

@darcyYe darcyYe commented Apr 1, 2024

Summary

update error handling of testing custom JWT:

  1. add API request body error handling for custom JWT console when testing
  2. update the custom JWT test API interface, which brings a more understandable error message (we reused zod error message formatter to compose the zod error message, previous interface is not easy to be understood by Logto user due to the nested zod variable path)
  3. reorder the content of sample user context to align with the zod guard, so that clicking reset button of sample user context does not change the content in the code editor

Testing

Tested locally.
image
Before this change, the error only show error code without detailed error message, which is hard for debugging.

Checklist

  • .changeset
  • unit tests
  • integration tests
  • necessary TSDoc comments

Copy link

github-actions bot commented Apr 1, 2024

COMPARE TO master

Total Size Diff 📈 +332 Bytes

Diff by File
Name Diff
packages/console/src/pages/CustomizeJwtDetails/MainContent/ScriptSection/ErrorContent/index.tsx 📈 +5 Bytes
packages/console/src/pages/CustomizeJwtDetails/MainContent/ScriptSection/use-test-handler.ts 📈 +630 Bytes
packages/console/src/pages/CustomizeJwtDetails/utils/config.tsx 0 Bytes
packages/console/src/pages/CustomizeJwtDetails/utils/format.ts 📈 +82 Bytes
packages/core/src/errors/RequestError/index.ts 📈 +7 Bytes
packages/core/src/routes/logto-config/jwt-customizer.ts 📈 +555 Bytes
packages/schemas/src/types/index.ts 📈 +37 Bytes
packages/schemas/src/types/jwt-customizer.ts 📈 +2.79 KB
packages/schemas/src/types/logto-config/index.ts 📈 +741 Bytes
packages/schemas/src/types/logto-config/jwt-customizer.ts 📈 +3.87 KB

@darcyYe darcyYe force-pushed the yemq-log-8493-update-custom-jwt-console-error-handling branch from f025e55 to 977776d Compare April 1, 2024 15:58
@darcyYe darcyYe merged commit 21560f9 into master Apr 2, 2024
19 checks passed
@darcyYe darcyYe deleted the yemq-log-8493-update-custom-jwt-console-error-handling branch April 2, 2024 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants