Repository navigation
fix(console): let the mock first-run wizard continue into the console - #205
Merged
Merged
Conversation
In mock mode with first run forced open, login always acted like a browser holding no certificate, even after the wizard finished or was skipped, so a reviewer could never get past the operator certificate step. Finishing or skipping the admin step now closes mock first run (closeMockBootstrap), and the install step signs straight in as the mock admin instead of reloading, which would only reset the mock state back to open. Live mode is unchanged: it still reloads and still needs a real operator certificate. Closes #198 Signed-off-by: Bugs5382 <12115015+Bugs5382@users.noreply.github.com>
Signed-off-by: Bugs5382 <12115015+Bugs5382@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
In mock mode with first run forced open (VITE_FLEET_MODE=mock, VITE_BOOTSTRAP_MOCK_STATE=open), login always acted like a browser holding no certificate, even after the wizard finished or was skipped, because it checked the static env flag instead of the current mock bootstrap state. A reviewer could never get past the operator certificate step.
src/lib/bootstrap.tsgainsisMockFirstRunOpen()(read byloginin mock mode) andcloseMockBootstrap(). Finishing or skipping the admin step (reaching the install step) now callscloseMockBootstrap(), mirroring how a live admin's first authenticated sign-in closes first run for real. The install step's button then signs straight in through the auth context in mock mode instead of reloading the page, since mock mode has no browser certificate for a reload to pick up and reloading would only reset the mock state back to open.Live mode is untouched: it never reads the mock bootstrap state, keeps the "Reload and sign in" button, and still needs a real operator certificate.
Closes #198
Verification
How this was verified
CI is the proof: Web CI runs lint, the vitest suite (new cases in
apps/console/src/context/auth.test.tsxcovering mock login while first run is open vs. closed, and inapps/console/src/components/first-run/first-run-wizard.test.tsxcovering path A and path B reaching install and then signing in through the console, plus a live-mode check that the reload button is unaffected), and the build, including the release-bundle check (this change adds no mock-fixture markers, so it stays clean). No local build or test was run on this box.