-
Notifications
You must be signed in to change notification settings - Fork 407
feat: remove resetPasswordToken field #1462
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: remove resetPasswordToken field #1462
Conversation
WalkthroughThis change removes all occurrences of the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant App
participant Server
User->>App: Request page or block info
App->>Server: Fetch user/page/block data
Server-->>App: Responds (without resetPasswordToken)
App->>User: Show lock/notification (username only)
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (5)
mockServer/src/database/blockCategories.db
is excluded by!**/*.db
mockServer/src/database/blockGroups.db
is excluded by!**/*.db
mockServer/src/database/blocks.db
is excluded by!**/*.db
mockServer/src/database/defaultData/default.db
is excluded by!**/*.db
mockServer/src/database/pages.db
is excluded by!**/*.db
📒 Files selected for processing (18)
mockServer/src/assets/json/appinfo.json
(5 hunks)mockServer/src/mock/get/app-center/apps/detail/1.json
(1 hunks)mockServer/src/mock/get/app-center/v1/apps/schema/1.json
(1 hunks)mockServer/src/mock/get/platform-center/courses.json
(0 hunks)mockServer/src/mock/get/platform-center/user/me.json
(0 hunks)mockServer/src/services/block.js
(1 hunks)mockServer/src/services/blocks.json
(2 hunks)mockServer/src/services/pages.js
(0 hunks)packages/canvas/DesignCanvas/src/DesignCanvas.vue
(1 hunks)packages/common/composable/defaultGlobalService.ts
(1 hunks)packages/common/js/canvas.js
(1 hunks)packages/plugins/block/src/composable/types.ts
(0 hunks)packages/plugins/materials/src/composable/types.ts
(0 hunks)packages/toolbars/lock/src/Main.vue
(1 hunks)packages/toolbars/save/src/js/index.ts
(1 hunks)packages/vue-generator/test/testcases/element-plus-case/mockData.js
(0 hunks)packages/vue-generator/test/testcases/generator/expected/appdemo01/src/router/index.js
(2 hunks)packages/vue-generator/test/testcases/generator/mockData.js
(2 hunks)
💤 Files with no reviewable changes (6)
- mockServer/src/services/pages.js
- packages/vue-generator/test/testcases/element-plus-case/mockData.js
- mockServer/src/mock/get/platform-center/user/me.json
- packages/plugins/block/src/composable/types.ts
- packages/plugins/materials/src/composable/types.ts
- mockServer/src/mock/get/platform-center/courses.json
🧰 Additional context used
🧬 Code Graph Analysis (1)
packages/common/js/canvas.js (2)
packages/register/src/common.ts (1)
getMetaApi
(54-64)packages/register/src/constants.ts (1)
META_SERVICE
(1-22)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: push-check
🔇 Additional comments (18)
mockServer/src/mock/get/app-center/apps/detail/1.json (1)
20-20
: Use simplified home_page ID for consistency.The
home_page
value has been updated from a complex string to"1"
, aligning with other mock data changes for unified page identifiers.mockServer/src/services/block.js (2)
27-33
: RemoveresetPasswordToken
from userInfo mock.The
userInfo
object no longer includes theresetPasswordToken
field, which matches the PR goal of removing unnecessary token properties.
Confirm that no mock consumers or front-end code rely on this field.
47-50
: StripresetPasswordToken
from occupier in blockModel.The nested
occupier
object no longer carries aresetPasswordToken
, ensuring consistency across mock entities.
Verify downstream services or test mocks expecting this field are updated accordingly.mockServer/src/services/blocks.json (1)
418-421
: Approve removal ofresetPasswordToken
fromoccupier
The mockoccupier
object correctly excludesresetPasswordToken
, matching the refactoring in other mock files and service layers. No further action needed.mockServer/src/mock/get/app-center/v1/apps/schema/1.json (1)
1693-1693
: ID replacement is consistent
The page identifier has been simplified from the complex string to"1"
, matching the updated default demo page ID across mocks and routing configs.packages/toolbars/save/src/js/index.ts (1)
139-142
: Remove sensitive token from lock message
ExcludingresetPasswordToken
from the lock notification avoids leaking sensitive data in the UI. The updated message now only surfaces the username.packages/vue-generator/test/testcases/generator/expected/appdemo01/src/router/index.js (2)
6-7
: Update root redirect to new route name
Redirect now points to'1'
, aligning with the createVm route’s updated name.
16-17
: Align createVm route name with page ID
The route name is updated to'1'
to match the simplified page identifier.packages/toolbars/lock/src/Main.vue (1)
90-91
: Simplify lock warning message
Removing the token from the warning ensures only the username is shown, preventing unnecessary exposure of credentials.mockServer/src/assets/json/appinfo.json (4)
4012-4012
: ValidatecreatedBy
object schema
OnlyresetPasswordToken
should be removed from user sub-objects. Ensure that essential fields (e.g.,confirmationToken
) aren’t inadvertently dropped and that this payload matches the API contract.
4021-4021
: Validateoccupier
object schema
Similar tocreatedBy
, confirm thatoccupier
contains all required properties and that onlyresetPasswordToken
was removed—no other user fields were lost.
29698-29698
: Ensurehome_page
matches an existing page ID
The new value"1"
must correspond to a defined page in this file, and the string type must align with downstream consumers’ expectations.
1755-1755
:✅ Verification successful
Verify all old page ID references removed
Confirm that the old identifier"NTJ4MjvqoVj8OVsc"
has been fully replaced across the mock data to prevent stale or inconsistent mocks.Please run:
🏁 Script executed:
#!/bin/bash # Ensure no references to the old page ID remain rg -n "NTJ4MjvqoVj8OVsc" mockServer/src/assets/json/appinfo.jsonLength of output: 64
No remaining references to old page ID
Verified thatNTJ4MjvqoVj8OVsc
no longer appears inmockServer/src/assets/json/appinfo.json
. All stale mock data has been cleaned up.packages/vue-generator/test/testcases/generator/mockData.js (1)
1856-1856
: LGTM! Simplified demo page identifiers.The change from complex string IDs to simple "1" improves readability of test mock data and aligns with the PR objective of standardizing demo page references.
Also applies to: 1874-1874
packages/canvas/DesignCanvas/src/DesignCanvas.vue (1)
111-113
: LGTM! Properly removes resetPasswordToken from lock message.The change successfully removes the
resetPasswordToken
interpolation while adding a fallback forusername
to prevent undefined values in the lock notification message. This aligns with the PR objective of removing sensitive token data.packages/common/js/canvas.js (2)
14-14
: LGTM! Removed unused import.The
useResource
import is no longer needed after removing the demo-related logic.
21-25
: LGTM! Simplified canvas status logic.The removal of demo-related conditions that depended on
resetPasswordToken
simplifies the function while maintaining correct behavior:
- No data → Release status
- Data exists → Compare user IDs for Occupy vs Lock status
This change aligns with the PR objective of removing
resetPasswordToken
dependencies.packages/common/composable/defaultGlobalService.ts (1)
215-222
:✅ Verification successful
Verify removal of isAdmin API method.
The
isAdmin
method that depended onstate.userInfo.resetPasswordToken
has been removed from the API. While this aligns with the PR objective of removingresetPasswordToken
dependencies, it represents a breaking change to the public API.
🏁 Script executed:
#!/bin/bash # Description: Check if any code still references the removed isAdmin method # Expected: No references should be found, confirming safe removal echo "Searching for isAdmin method usage..." rg -A 3 "\.isAdmin\(" --type js --type ts --type vue echo "" echo "Searching for isAdmin property access..." rg -A 3 "\.isAdmin\b" --type js --type ts --type vueLength of output: 352
I’ll expand the search to all file types, removing the
--type
filters:
🏁 Script executed:
#!/bin/bash # Re-run search for any remaining isAdmin references across all files echo "Searching for isAdmin method calls..." rg -A 3 '\.isAdmin\(' || true echo "" echo "Searching for isAdmin property access..." rg -A 3 '\.isAdmin\b' || trueLength of output: 248
isAdmin Removal Confirmed Safe
No remaining references to the removed
isAdmin
API method were found across the codebase. This breaking change aligns with the PR’s cleanup goal and can be considered safe to merge.
English | 简体中文
#breaking
PR
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
Background and solution
变更点:
resetPasswordToken
字段isDemo
页面状态的判断。PAGE_STATUS: GUEST
字段。将页面状态判断抽取成一个元服务isAdmin
的方法。1
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit
Summary by CodeRabbit
Bug Fixes
Refactor
Chores