fix: prefill administrator role for local Docker login#93
Merged
Conversation
Allow the SWA emulator's default authenticated role only in the UI Docker image. Development mode then auto-provisions that local user as an administrator, and the local setup documentation now reflects the default flow.
Patch the SWA CLI authentication portal only inside the local UI image so administrators is shown and submitted by default, including for cached emulator profiles. Update local setup documentation to match the verified login flow.
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.
Summary
Prefill the
administratorsrole in the Azure Static Web Apps mock-login portal used by Docker Compose. Local users can now enter a user ID and username and log in without knowing that they must manually add the HASTE administrator role.The change is isolated to the SWA CLI installed inside the local UI Docker image. Production authorization and the source
staticwebapp.config.jsonremain unchanged.Changes
administratorsin its default roles.administrators.Testing
anonymous,authenticated, andadministrators.administrators.cd ui && npm run buildcd ui && npm run lintis blocked by the repository's existing ESLint 9 configuration mismatch (eslint.config.jsis not present).Review Notes
The Docker build performs a guarded replacement against the installed SWA CLI asset. If a future SWA CLI release changes that asset, the build fails with
Unexpected SWA auth portalso the local authentication behavior cannot regress silently.