Azure / Azure/static-web-apps

Adding setting to `responseOverrides` to exclude certain paths

Open
#762 0 comments 3 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
346
Forks
67
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**

If authentication is enabled for the entire Static Web Apps, as in the example in the official documentation, a 302 redirect will be performed if the authentication session is expired when the API is executed, and the session expiration cannot be handled.

To avoid this problem, I would like to be able to convert a 401 to a 302 redirect only if it is not under a specific path (e.g. `/api` or `/assets`).

**Describe the solution you'd like**

Please add an `exclude` specification similar to `navigationFallback` to the `responseOverrides` setting. This will allow us to treat anything under `/api` as a 401 without changing it to a 302 redirect.

**Describe alternatives you've considered**

None

**Additional context**

![image](https://user-images.githubusercontent.com/1356444/158668419-ae09de7e-82f9-477b-8218-c8df2864a8f8.png)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.