[6943] Pinia Task 14 - account-settings #6979
[6943] Pinia Task 14 - account-settings #6979n-lark wants to merge 8 commits into6942-pinia-task-13-account-teamfrom
Conversation
… into 6943-pinia-task-14-account-settings
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 6942-pinia-task-13-account-team #6979 +/- ##
================================================================
Coverage 76.29% 76.29%
================================================================
Files 403 403
Lines 20296 20296
Branches 4881 4881
================================================================
Hits 15485 15485
Misses 4811 4811
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…4-account-settings
| await this.checkAccess() | ||
| this.getSettings() | ||
| if (this.isHTTPBearerTokensFeatureEnabled()) { | ||
| if (this.featuresCheck.isHTTPBearerTokensFeatureEnabled) { |
There was a problem hiding this comment.
isHTTPBearerTokensFeatureEnabled was a computed property called with (), throwing a TypeError that silently prevented getTokens() from ever running.
Fixing the boolean call exposed two issues:
-
Permission race —
checkAccess()wasn't returning a value somounted()was accidentally bailing out beforegetTokens()could fire. Once fixed,getTokens()ran for the first time, including for viewers/members without permission, causing an unhandled 403 that failed Cypress. Fixed by makingcheckAccess()returnfalsesomounted()bails immediately for unauthorized users. The same permission check was added to thehttpNodeAuth_typewatcher which bypassedcheckAccess(). -
Application owner vs team member mismatch — a user can be an application-level owner (passing the client-side
hasPermission('project:edit', { application })check) but only a team-level viewer/member. The server-side tokens endpoint checks team-level membership and returns 403 in this case. This mismatch pre-existed our changes but was hidden by the TypeError. Thetry/catchhandles it gracefully, the token table stays empty, which is the correct UI state for this permission combination.
The try/catch isn't ideal here so we should probably create another ticket to address - the proper fix is to align the client-side permission check for getTokens() with the team-level check the server uses. Lmk if we are cool with me raising an issue for this.
… into 6943-pinia-task-14-account-settings
Description
See details here & test plan here.
Related Issue(s)
Resolves #6943
Checklist
flowforge.yml?FlowFuse/helmto update ConfigMap TemplateFlowFuse/CloudProjectto update values for Staging/ProductionLabels
area:migrationlabel