Skip to content

Commit 8af5d48

Browse files
committed
dx: allow for localhost firebase signin
1 parent 6739123 commit 8af5d48

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/runtime/pages/SignIn.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
GoogleAuthProvider,
55
sendPasswordResetEmail,
66
signInWithEmailAndPassword,
7-
// signInWithPopup, // use this with localhost, still might need to refresh or manually update address bar
7+
signInWithPopup,
88
signInWithRedirect,
99
} from 'firebase/auth'
1010
import type { VForm } from 'vuetify/components'
@@ -150,7 +150,14 @@ async function signinWithGoogle() {
150150
)
151151
return
152152
}
153-
signInWithRedirect(auth, googleProvider)
153+
if (import.meta.dev) {
154+
// Use this with localhost, still might need to refresh or manually update address bar
155+
signInWithPopup(auth, googleProvider)
156+
}
157+
else {
158+
// Doesn't work on localhost
159+
signInWithRedirect(auth, googleProvider)
160+
}
154161
}
155162
</script>
156163

0 commit comments

Comments
 (0)