Skip to content
New issue

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

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

Already on GitHub? # to your account

chore: add error message for invalid project id #3579

Merged
merged 2 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .changeset/big-olives-ring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
'@reown/appkit-utils': patch
'@reown/appkit': patch
'@reown/appkit-adapter-bitcoin': patch
'@reown/appkit-adapter-ethers': patch
'@reown/appkit-adapter-ethers5': patch
'@reown/appkit-adapter-solana': patch
'@reown/appkit-adapter-wagmi': patch
'@reown/appkit-cdn': patch
'@reown/appkit-cli': patch
'@reown/appkit-common': patch
'@reown/appkit-core': patch
'@reown/appkit-experimental': patch
'@reown/appkit-polyfills': patch
'@reown/appkit-scaffold-ui': patch
'@reown/appkit-siwe': patch
'@reown/appkit-siwx': patch
'@reown/appkit-ui': patch
'@reown/appkit-wallet': patch
'@reown/appkit-wallet-button': patch
---

Added an error message for when the user provides an invalid project id.
8 changes: 8 additions & 0 deletions packages/appkit-utils/src/ErrorUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ export const ErrorUtil = {
JWT_VALIDATION_ERROR: {
message: 'JWT validation error: JWT Token is not yet valid',
alertErrorKey: 'JWT_TOKEN_NOT_VALID'
},
INVALID_KEY: {
message: 'Unauthorized: invalid key',
alertErrorKey: 'INVALID_PROJECT_ID'
}
},
ALERT_ERRORS: {
Expand All @@ -32,6 +36,10 @@ export const ErrorUtil = {
longMessage:
'Invalid session found on UniversalProvider - please check your time settings and connect again'
},
INVALID_PROJECT_ID: {
shortMessage: 'Invalid App Configuration',
longMessage: 'Invalid Project ID - update configuration'
},
PROJECT_ID_NOT_CONFIGURED: {
shortMessage: 'Project ID Not Configured',
longMessage: 'Project ID Not Configured - update configuration on cloud.reown.com'
Expand Down
5 changes: 5 additions & 0 deletions packages/appkit/tests/appkit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1421,6 +1421,11 @@ describe('Base', () => {
alert: ErrorUtil.ALERT_ERRORS.JWT_TOKEN_NOT_VALID,
message:
'WebSocket connection closed abnormally with code: 3000 (JWT validation error: JWT Token is not yet valid:)'
},
{
alert: ErrorUtil.ALERT_ERRORS.INVALID_PROJECT_ID,
message:
'Uncaught Error: WebSocket connection closed abnormally with code: 3000 (Unauthorized: invalid key)'
}
]

Expand Down
Loading