Skip to content

Commit 07441e9

Browse files
committed
refactor: update firebase imports to use web-extension version
1 parent a8cc681 commit 07441e9

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

src/features/auth/components/AuthModal.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { AuthProvider, GithubAuthProvider, GoogleAuthProvider } from 'firebase/auth'
1+
import { GithubAuthProvider, GoogleAuthProvider } from 'firebase/auth/web-extension'
22
import { useCallback, useState } from 'react'
33
import { FaGithub } from 'react-icons/fa'
44
import { FcGoogle } from 'react-icons/fc'
@@ -18,6 +18,7 @@ type AuthModalProps = {
1818
const googleAuthProvider = new GoogleAuthProvider()
1919
const githubAuthProvider = new GithubAuthProvider()
2020

21+
type AuthProvider = GoogleAuthProvider | GithubAuthProvider
2122
export const AuthModal = ({ showAuth }: AuthModalProps) => {
2223
const { closeAuthModal, authError, setAuthError } = useAuth()
2324
const [selectedProvider, setSelectedProvider] = useState<AuthProvider>(googleAuthProvider)

src/features/auth/hooks/useAuth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { signOut } from 'firebase/auth'
1+
import { signOut } from 'firebase/auth/web-extension'
22
import { AuthModalStore, AuthStore } from 'src/features/auth'
33
import { trackUserDisconnect } from 'src/lib/analytics'
44
import { firebaseAuth } from 'src/lib/firebase'

src/lib/firebase.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { initializeApp } from 'firebase/app'
2-
import { getAuth } from 'firebase/auth'
2+
import { getAuth } from 'firebase/auth/web-extension'
33
import { FIREBASE_API_KEY } from 'src/config'
44

55
const firebaseConfig = {

src/providers/AuthProvider.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import { GithubAuthProvider, GoogleAuthProvider, signInWithCredential } from 'firebase/auth'
1+
import {
2+
GithubAuthProvider,
3+
GoogleAuthProvider,
4+
signInWithCredential,
5+
} from 'firebase/auth/web-extension'
26
import { useCallback, useEffect } from 'react'
37
import { useNavigate, useSearchParams } from 'react-router-dom'
48
import toast from 'react-simple-toasts'

0 commit comments

Comments
 (0)