-
Notifications
You must be signed in to change notification settings - Fork 1
SWA auth #24
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
Conversation
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.
Pull request overview
This pull request adds Static Web App authentication configuration to protect API endpoints and handle unauthenticated access. However, the implementation contains several critical issues that will prevent the configuration from working correctly.
- Addition of
staticwebapp.config.jsonto configure authentication and routing rules for Azure Static Web Apps - Update to the project file to copy the configuration file during build
- Configuration of routes to restrict API access and handle 401 responses
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| Bezalu.ProjectReporting.Web/staticwebapp.config.json | Adds Static Web App configuration with authentication rules, but contains critical JSON syntax errors and authentication provider inconsistencies |
| Bezalu.ProjectReporting.Web/Bezalu.ProjectReporting.Web.csproj | Configures build to copy staticwebapp.config.json, but references incorrect file path (wwwroot instead of project root) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@MWG-Logan I've opened a new pull request, #25, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This pull request introduces configuration for static web app authentication and routing in the project. The main changes are the addition of a
staticwebapp.config.jsonfile to define custom routes, authentication rules, and response overrides, and ensuring this configuration is copied to the output directory during builds.Static web app configuration:
staticwebapp.config.jsontowwwrootwith routes restricting/api/*to authenticated users, a custom login route, and a 401 response override to redirect unauthenticated users to GitHub login.Build process update:
Bezalu.ProjectReporting.Web.csprojto copystaticwebapp.config.jsonto the output directory on build, ensuring deployment includes the correct configuration.