Skip to content

fix: prefill administrator role for local Docker login#93

Merged
mgmachado merged 2 commits into
mainfrom
v-joaquinri/fix-local-docker-admin-role
Jul 17, 2026
Merged

fix: prefill administrator role for local Docker login#93
mgmachado merged 2 commits into
mainfrom
v-joaquinri/fix-local-docker-admin-role

Conversation

@jQuinRivero

@jQuinRivero jQuinRivero commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Prefill the administrators role 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.json remain unchanged.

Changes

  • Patch the Docker image's SWA mock-login portal to include administrators in its default roles.
  • Merge the default roles into cached emulator profiles so existing local browser sessions also receive administrators.
  • Fail the image build if the expected SWA portal structure changes instead of silently losing the default.
  • Update the quickstart, Docker, local-development, and configuration documentation to describe the new login flow.

Testing

  • Built the UI Docker image locally.
  • Verified the served SWA login page pre-fills anonymous, authenticated, and administrators.
  • Verified a browser profile that had cached the old role list receives administrators.
  • Completed a mock login through the isolated UI container.
  • cd ui && npm run build
  • Formal pre-landing review completed with no findings.
  • cd ui && npm run lint is blocked by the repository's existing ESLint 9 configuration mismatch (eslint.config.js is 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 portal so the local authentication behavior cannot regress silently.

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.
@jQuinRivero
jQuinRivero requested a review from a team as a code owner July 16, 2026 20:44
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.
@jQuinRivero jQuinRivero changed the title fix: default local Docker users to administrator access fix: prefill administrator role for local Docker login Jul 16, 2026

@mgmachado mgmachado left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mgmachado
mgmachado merged commit 4fbdd56 into main Jul 17, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants