Azure / Azure/static-web-apps

[Bug] Routing rules not respected for /.auth suffix

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

Description

**Describe the bug**

I'd like to enable only one auth provider and disable all others. For that I'm using this `staticwebapp.config.json`:

```json
{
"routes": [
{
"route": "/.auth/login/github",
"statusCode": 200
},
{
"route": "/.auth/login/*",
"statusCode": 404
}
]
}
```

This basically tell that the GitHub route is fine, while all other should return a 404.
This works perfectly locally using SWA CLI, but when deployed on SWA it's completely broken:

- `/.auth/login/github` just results in a blank page (only status 200 was returned...)
- Any other auth providers works as usual!

**Expected behavior**
GitHub auth provider works, and other providers returns a 404 error.

**Additional context**
Routes likes these (expection first, then using a wildcard to set a common rules for the rest a path) works with any other hosts like Netlify, Vercel, etc. The fact that it works as expected with the SWA CLI is also a good sign that `/.auth/` routes should be processed just like the rest.

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.