Skip to content

Commit 4d2a54f

Browse files
authored
[Auth] Make the persistences default to inMemory for node (#5527)
* Make the persistences default to inMemory for node * Add changeset * Update changeset to be "minor" instead of "patch"
1 parent b79bd33 commit 4d2a54f

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

.changeset/swift-shirts-appear.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@firebase/auth": minor
3+
---
4+
5+
Update all persistences to map to `inMemoryPersistence` in Node, to avoid errors with server-side rendering

packages/auth/src/platform_node/index.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { _createError } from '../core/util/assert';
2121
import { FirebaseApp, getApp, _getProvider } from '@firebase/app';
2222
import { Auth } from '../model/public_types';
2323

24-
import { initializeAuth } from '..';
24+
import { initializeAuth, inMemoryPersistence } from '..';
2525
import { registerAuth } from '../core/auth/register';
2626
import { ClientPlatform } from '../core/util/version';
2727
import { AuthImpl } from '../core/auth/auth_impl';
@@ -76,9 +76,9 @@ class FailClass {
7676
}
7777
}
7878

79-
export const browserLocalPersistence = NOT_AVAILABLE_ERROR;
80-
export const browserSessionPersistence = NOT_AVAILABLE_ERROR;
81-
export const indexedDBLocalPersistence = NOT_AVAILABLE_ERROR;
79+
export const browserLocalPersistence = inMemoryPersistence;
80+
export const browserSessionPersistence = inMemoryPersistence;
81+
export const indexedDBLocalPersistence = inMemoryPersistence;
8282
export const browserPopupRedirectResolver = NOT_AVAILABLE_ERROR;
8383
export const PhoneAuthProvider = FailClass;
8484
export const signInWithPhoneNumber = fail;

0 commit comments

Comments
 (0)