@ciridae/auth 0.1.0 → 0.1.1
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getApps, initializeApp } from "firebase/app";
|
|
2
|
-
import { getAuth,
|
|
2
|
+
import { getAuth, onAuthStateChanged, signInWithCustomToken, signOut as firebaseSignOut, } from "firebase/auth";
|
|
3
3
|
import { AuthenticatedUserSchema } from "./authenticatedUser.js";
|
|
4
4
|
import { buildCiridaeSignInUrl, buildCiridaeSignOutUrl, } from "./authServiceUrls.js";
|
|
5
5
|
const FIREBASE_APP_NAME = "ciridae-browser-auth";
|
|
@@ -84,9 +84,7 @@ function createFirebaseAuth(identityConfiguration, authServiceConfiguration) {
|
|
|
84
84
|
: null;
|
|
85
85
|
},
|
|
86
86
|
async subscribe(onAuthenticatedUser) {
|
|
87
|
-
|
|
88
|
-
await setPersistence(firebaseAuth, inMemoryPersistence);
|
|
89
|
-
return onAuthStateChanged(firebaseAuth, (user) => {
|
|
87
|
+
return onAuthStateChanged(getFirebaseAuth(), (user) => {
|
|
90
88
|
onAuthenticatedUser(user ? AuthenticatedUserSchema.parse(user) : null);
|
|
91
89
|
});
|
|
92
90
|
},
|