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

[Feature] login signup error handling flow #115

Merged
merged 9 commits into from
Oct 3, 2023

Conversation

badukwei
Copy link
Collaborator

@badukwei badukwei commented Sep 27, 2023

Summary

Adding error handling methods and error message templates

Linked Issue

close #105

Details

  1. 新增 errorMessage 相關處理流程,如果用戶登入或註冊失敗則會跳出相應的錯誤訊息
  2. refactor routes protection
  3. 簡單修改 styles

Impacted Areas

packages/frontend/src/components/login/AuthForm.tsx
packages/frontend/src/components/modal/ErrorModal.tsx
packages/frontend/src/components/modal/Modal.tsx
packages/frontend/src/components/modal/SignupLoadingModal.tsx
packages/frontend/src/constants/error-messages/loginErrorMessage.ts
packages/frontend/src/contexts/ProtectedRoute.tsx
packages/frontend/src/contexts/User.tsx
packages/frontend/src/hooks/useAutoNavigation.ts
packages/frontend/src/hooks/useErrorMessage.ts
packages/frontend/src/hooks/useLocalStorage.ts
packages/frontend/src/hooks/useLoginWithServer.ts
packages/frontend/src/hooks/useLoginWithWallet.ts
packages/frontend/src/hooks/useSignupWithServer.ts
packages/frontend/src/hooks/useSignupWithWallet.ts
packages/frontend/src/pages/PostCreate.tsx
packages/frontend/src/layouts/AppLayout.tsx
packages/frontend/src/pages/Login.tsx
packages/frontend/src/index.tsx

Tests

  • Error handling
  1. 使用錢包進行註冊
  2. 在錢包跳出是否同意實選擇拒絕
  3. 跳出錯誤訊息
  • Route protects
  1. 在尚未登入時進入 home or /profile etc. 則會 redirect to /login

@github-actions github-actions bot added frontend refactor cleanup/refactor labels Sep 27, 2023
@badukwei
Copy link
Collaborator Author

This pr is ready for review. @kittybest @vivianjeng

@vivianjeng
Copy link
Contributor

main branch is updated, please resolve the conflicts 🙏🏻

@badukwei
Copy link
Collaborator Author

I've resolved all issues in the pr. Please check it @vivianjeng. Thanks!

Copy link
Contributor

@vivianjeng vivianjeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

packages/frontend/src/hooks/useErrorMessage.ts Outdated Show resolved Hide resolved
@badukwei
Copy link
Collaborator Author

badukwei commented Oct 1, 2023

How should I solve this? Although It has been aproved, merging is still blocked. @vivianjeng
image

@vivianjeng vivianjeng merged commit a4f2a3c into main Oct 3, 2023
7 checks passed
@vivianjeng vivianjeng deleted the feature/login-signup-error-message branch October 3, 2023 04:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend refactor cleanup/refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Frontend] replace console.error with readable message and display it
3 participants