@tern-secure/nextjs 1.8.9 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3,38 +3,16 @@ import { getAuth, setPersistence, browserSessionPersistence } from 'firebase/aut
|
|
|
3
3
|
import { getFirestore } from 'firebase/firestore';
|
|
4
4
|
import { getStorage } from 'firebase/storage';
|
|
5
5
|
import { loadFireConfig, validateConfig } from './config';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
storage = getStorage(app);
|
|
19
|
-
}
|
|
20
|
-
return app;
|
|
21
|
-
};
|
|
22
|
-
export const getTernSecureAuth = () => {
|
|
23
|
-
if (!auth) {
|
|
24
|
-
initialize();
|
|
25
|
-
}
|
|
26
|
-
return auth;
|
|
27
|
-
};
|
|
28
|
-
export const getTernSecureFirestore = () => {
|
|
29
|
-
if (!firestore) {
|
|
30
|
-
initialize();
|
|
31
|
-
}
|
|
32
|
-
return firestore;
|
|
33
|
-
};
|
|
34
|
-
export const getTernSecureStorage = () => {
|
|
35
|
-
if (!storage) {
|
|
36
|
-
initialize();
|
|
37
|
-
}
|
|
38
|
-
return storage;
|
|
39
|
-
};
|
|
6
|
+
// Initialize immediately
|
|
7
|
+
const app = (() => {
|
|
8
|
+
const config = validateConfig(loadFireConfig());
|
|
9
|
+
return getApps().length ? getApps()[0] : initializeApp(config);
|
|
10
|
+
})();
|
|
11
|
+
const auth = getAuth(app);
|
|
12
|
+
setPersistence(auth, browserSessionPersistence);
|
|
13
|
+
const firestore = getFirestore(app);
|
|
14
|
+
const storage = getStorage(app);
|
|
15
|
+
export const getTernSecureAuth = () => auth;
|
|
16
|
+
export const getTernSecureFirestore = () => firestore;
|
|
17
|
+
export const getTernSecureStorage = () => storage;
|
|
40
18
|
//# sourceMappingURL=client-init.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-init.js","sourceRoot":"","sources":["../../../src/app-router/client/client-init.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client-init.js","sourceRoot":"","sources":["../../../src/app-router/client/client-init.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,aAAa,EAAe,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,OAAO,EAAQ,cAAc,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AACzF,OAAO,EAAE,YAAY,EAAa,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAmB,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAG1D,yBAAyB;AACzB,MAAM,GAAG,GAAG,CAAC,GAAG,EAAE;IAChB,MAAM,MAAM,GAAG,cAAc,CAAC,cAAc,EAAE,CAAC,CAAC;IAChD,OAAO,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;AACjE,CAAC,CAAC,EAAE,CAAC;AAEL,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;AAC1B,cAAc,CAAC,IAAI,EAAE,yBAAyB,CAAC,CAAC;AAChD,MAAM,SAAS,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;AACpC,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;AAEhC,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC;AAC5C,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,EAAE,CAAC,SAAS,CAAC;AACtD,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC"}
|