-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
feat(auth): support the "Forgot Password" function #6616
base: develop
Are you sure you want to change the base?
Conversation
…rd link generation
…ons with ACL permissions
…r and improve token validation
…gnInForm to use it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new "Forgot Password" feature to the auth plugin. Key changes include:
- Addition of new server endpoints for lost password, reset password, and token validation
- Comprehensive tests for lost and reset password flows
- New client pages and UI integrations for both "Forgot Password" and "Reset Password" functionalities
Reviewed Changes
Copilot reviewed 17 out of 24 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
packages/plugins/@nocobase/plugin-auth/src/server/actions/auth.ts | Implements new endpoints for lostPassword, resetPassword, and checkResetToken |
packages/plugins/@nocobase/plugin-auth/src/server/tests/* | Adds tests covering the new password reset flows |
packages/plugins/@nocobase/plugin-auth/src/client/pages/* | Adds new pages for Forgot Password and Reset Password UI |
packages/plugins/@nocobase/plugin-auth/src/client/* | Updates routing and SignIn UI to integrate with the new features |
packages/core/sdk/src/APIClient.ts | Adds client methods to invoke the new auth endpoints |
packages/core/client/src/schema-component/antd/password/Password.tsx | Enhances Password input with a "Forgot password?" button |
Files not reviewed (7)
- packages/plugins/@nocobase/plugin-auth/src/locale/de-DE.json: Language not supported
- packages/plugins/@nocobase/plugin-auth/src/locale/en-US.json: Language not supported
- packages/plugins/@nocobase/plugin-auth/src/locale/it-IT.json: Language not supported
- packages/plugins/@nocobase/plugin-auth/src/locale/ja-JP.json: Language not supported
- packages/plugins/@nocobase/plugin-auth/src/locale/ko-KR.json: Language not supported
- packages/plugins/@nocobase/plugin-auth/src/locale/nl-NL.json: Language not supported
- packages/plugins/@nocobase/plugin-auth/src/locale/zh-CN.json: Language not supported
Comments suppressed due to low confidence (2)
packages/plugins/@nocobase/plugin-auth/src/client/basic/SignInForm.tsx:113
- The variable 'options' is used in the getPasswordForm call but is not defined; consider replacing it with the appropriate reference (e.g., authenticator.options).
return <SchemaComponent schema={getPasswordForm({ showForgotPassword: options?.enableResetPassword })} scope={{ useBasicSignIn, allowSignUp, signUpLink, t }} />;
packages/plugins/@nocobase/plugin-auth/src/client/pages/ResetPasswordPage.tsx:86
- The useEffect hook has an empty dependency array while using 'resetToken'; consider including 'resetToken' in the dependency array to ensure the effect updates if the URL changes.
useEffect(() => { api.auth.checkResetToken({ resetToken }).then(() => { setExpired(false); }).catch((error) => { setExpired(true); }); }, []);
Tests results for "E2E"31 failed 91 flaky1077 passed, 48 skipped Full HTML report. Merge workflow run. |
This is a ...
Showcase
Changelog
Docs
Checklists