Skip to content

Commit d3f1501

Browse files
committed
dx: use signInWithPopup in dev
1 parent ae4542b commit d3f1501

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/runtime/pages/SignIn.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ async function forgotPassword() {
146146
async function signinWithGoogle() {
147147
// Firebase auth logic
148148
if (!auth) {
149-
console.log(
149+
console.warn(
150150
`[${nuxtifyConfig.brand?.name}] Firebase auth provider not found.`,
151151
)
152152
return

src/runtime/pages/SignUp.vue

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { FirebaseError } from 'firebase/app'
33
import {
44
createUserWithEmailAndPassword,
55
GoogleAuthProvider,
6+
signInWithPopup,
67
signInWithRedirect,
78
} from 'firebase/auth'
89
import type { VForm } from 'vuetify/components'
@@ -98,12 +99,19 @@ async function submitForm() {
9899
async function signinWithGoogle() {
99100
// Firebase auth logic
100101
if (!auth) {
101-
console.log(
102+
console.warn(
102103
`[${nuxtifyConfig.brand?.name}] Firebase auth provider not found.`,
103104
)
104105
return
105106
}
106-
signInWithRedirect(auth, googleProvider)
107+
if (import.meta.dev) {
108+
// Use this with localhost, still might need to refresh or manually update address bar
109+
signInWithPopup(auth, googleProvider)
110+
}
111+
else {
112+
// Doesn't work on localhost
113+
signInWithRedirect(auth, googleProvider)
114+
}
107115
}
108116
</script>
109117

0 commit comments

Comments
 (0)