index.html single-page app rewrite rule defeats email actions paths
See original GitHub issueFirebase CLI prompts users to set a rewrite rule for SPAs.
"rewrites": [
{
"source": "**/!{*.*}",
"destination": "/index.html"
}
]
Email verification, email change notification emails and password reset emails all use the __/auth/action
paths. These auth action urls forward to index.html
given the SPA rewrite rule.
And can anyone who knows Firebase glob patterns figure out some way to exclude paths beginning in __
from the rewrite?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Configure as a single-page app (rewrite all urls to /index.html)
I just used the Firebase CLI to init a static hosting project. What exactly happens when you enable the "configure as a single-page...
Read more >Dynamic URL Rewriting at the edge with Cloudflare
Dynamic and static rewrites. The first available Transform Rule action is rewrite . It allows users to match on HTTP requests and modify...
Read more >IIS Rewrite Rule for Single Page Apps - Matt Burke
In IIS, you can use the rewrite module to teach the webserver to respond to all urls by returning your main index. html...
Read more >How to Set Up an HTML Redirect on Your Website
HTML redirects are the simplest way to redirect a URL. ... To redirect one HTML page to another page, you need to add...
Read more >How to Build a Full-Stack Single Page Application with ...
to know how to install software; a basic understanding of HTML, CSS, JavaScript, and PHP; knowledge of at least one JavaScript framework and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ok, its seems the service worker was intercepting the requests.
Fixed it by adding a navigateFallbackWhitelist property to sw-precache-config.js:
Also note that what I said about it affecting custom and non-custom domains was wrong (after more testing). Localhost and custom domains work fine; the problem only occurs on firebaseapp.com sub-domains but can be fixed with the above configuration.
Do you have a service worker that has its own rewrite logic? The
/__/auth/*
reserved URLs take precedence over user-supplied rewrites (I double-confirmed that today), but if you have a service worker doing its own rewriting that could explain the issue.