firebase / firebase/firebase-js-sdk

In Firebase Auth, using "Redirect Best Practices" prevents testing with localhost because it always uses HTTPS

Open
#7,342 41 comments 18 reactions 0 assignees View on GitHub
api: auth needs-attention question v9
Dominant language
TypeScript
Stars
5.1k
Forks
1k
Avg merge
2d 21h
Merged PRs (30d)
37

Description

### Operating System

Windows

### Browser Version

Firefox 113

### Firebase SDK Version

9.22.1

### Firebase SDK Product:

Auth

### Describe your project's tooling

Vue with Vite

### Describe the problem

Following https://firebase.google.com/docs/auth/web/redirect-best-practices, it appears that our app should supply the current host as the authDomain. For development, we want to use `localhost:3000`. In bug #7233, it appeared that this should now support a value of `localhost:3000`, but when I tried it, it fails with an error because it tries to redirect to `http*s*://localhost:3000/...`.

This appears to be because in `packages/auth/src/core/util/handler.ts` in `getHandlerBase` there is a hard-coded `https` in the URL, but localhost requires `http`.

### Steps and code to reproduce issue

Use signInWithRedirect with an authDomain of localhost:3000. It will redirect to HTTPS.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.