Skip to content

VIRTUAL_PREFIX incompatible with Firebase sign in with redirect best practices #608

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

Open
mseeley opened this issue Mar 19, 2025 · 0 comments

Comments

@mseeley
Copy link

mseeley commented Mar 19, 2025

Environment

Description

/__ prefix is a Firebase SDK reserved URL. It allows consumer to load Firebase auth assets as if they were originally served by our origin. This is documented in their best practices documentation as authDomain.

The /__/vue-router/auto/route-block request 404s. This appears to prevent the associated route from loading:

Image

Questions

We've already worked around using nginx (see below). But, it would be surprising if /__ is unused by other applications.

Could VIRTUAL_PREFIX be configurable or something static but intentionally more difficult to collide with other routes?

Or, could consumers import the virtual routes in another way which avoids a virtual prefix?

Many thanks for everything. Please let me know if there's any other information I can provide.

Additional Context

Here's a snippet of our development nginx.conf. Notice how partner.localniuhi.dev/ goes to Vite while partner.localniuhi.dev/__/ goes to Firebase?

server {
    server_name partner.localniuhi.dev;
    listen 80;
    listen 443 ssl;

    location / {
      proxy_pass http://localhost:3210;
      proxy_set_header Host $host;
    }

    location /__/ {
      proxy_pass https://pineapple-6d4f2.firebaseapp.com/__/;
      proxy_set_header Host $host;
    }

    # Our workaround.
    location /__/vue-router/auto/route-block {
      proxy_pass http://localhost:3210/__/vue-router/auto/route-block;
      proxy_set_header Host $host;
    }
}

The VIRTUAL_PREFIX constant is hardcoded to /__.

export const VIRTUAL_PREFIX = '/__'

Without the workaround, this results in requests /__/vue-router/auto/route-block and 404 responses from Firebase:

Image

Loading from Vite directly shows the expected result:

Image
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

No branches or pull requests

1 participant