@ciridae/auth 0.1.1 → 0.1.2

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, onAuthStateChanged, signInWithCustomToken, signOut as firebaseSignOut, } from "firebase/auth";
2
+ import { getAuth, inMemoryPersistence, onAuthStateChanged, setPersistence, 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,7 +84,9 @@ function createFirebaseAuth(identityConfiguration, authServiceConfiguration) {
84
84
  : null;
85
85
  },
86
86
  async subscribe(onAuthenticatedUser) {
87
- return onAuthStateChanged(getFirebaseAuth(), (user) => {
87
+ const firebaseAuth = getFirebaseAuth();
88
+ await setPersistence(firebaseAuth, inMemoryPersistence);
89
+ return onAuthStateChanged(firebaseAuth, (user) => {
88
90
  onAuthenticatedUser(user ? AuthenticatedUserSchema.parse(user) : null);
89
91
  });
90
92
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ciridae/auth",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "engines": {