File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change
1
+ import { initializeApp , getApps , FirebaseOptions } from "firebase/app"
2
+
3
+ export default function getFirebase ( firebaseOptions : FirebaseOptions ) {
4
+ const apps = getApps ( )
5
+ const app = apps . find ( ( app ) => app . name === firebaseOptions . projectId )
6
+ if ( app ) {
7
+ return app
8
+ } else {
9
+ return initializeApp ( firebaseOptions )
10
+ }
11
+ }
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import type {
25
25
} from "next-auth/adapters"
26
26
27
27
import { getConverter } from "./converter"
28
+ import getFirebase from "./getFirebase"
28
29
29
30
export type IndexableObject = Record < string , unknown >
30
31
@@ -39,7 +40,7 @@ export function FirestoreAdapter({
39
40
emulator,
40
41
...firebaseOptions
41
42
} : FirebaseOptions & FirestoreAdapterOptions ) : Adapter {
42
- const firebaseApp = initializeApp ( firebaseOptions )
43
+ const firebaseApp = getFirebase ( firebaseOptions )
43
44
const db = getFirestore ( firebaseApp )
44
45
45
46
if ( emulator ) {
Original file line number Diff line number Diff line change 69
69
"preact-render-to-string" : " 5.2.3"
70
70
},
71
71
"peerDependencies" : {
72
- "nodemailer" : " 6.8.0"
72
+ "nodemailer" : " ^ 6.8.0"
73
73
},
74
74
"peerDependenciesMeta" : {
75
75
"nodemailer" : {
92
92
"postcss" : " 8.4.19" ,
93
93
"postcss-nested" : " 6.0.0"
94
94
}
95
- }
95
+ }
You can’t perform that action at this time.
0 commit comments