Skip to content

Commit

Permalink
[Auth] Make the persistences default to inMemory for node (#5527)
Browse files Browse the repository at this point in the history
* Make the persistences default to inMemory for node

* Add changeset

* Update changeset to be "minor" instead of "patch"
  • Loading branch information
sam-gc committed Sep 22, 2021
1 parent b79bd33 commit 4d2a54f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/swift-shirts-appear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@firebase/auth": minor
---

Update all persistences to map to `inMemoryPersistence` in Node, to avoid errors with server-side rendering
8 changes: 4 additions & 4 deletions packages/auth/src/platform_node/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { _createError } from '../core/util/assert';
import { FirebaseApp, getApp, _getProvider } from '@firebase/app';
import { Auth } from '../model/public_types';

import { initializeAuth } from '..';
import { initializeAuth, inMemoryPersistence } from '..';
import { registerAuth } from '../core/auth/register';
import { ClientPlatform } from '../core/util/version';
import { AuthImpl } from '../core/auth/auth_impl';
Expand Down Expand Up @@ -76,9 +76,9 @@ class FailClass {
}
}

export const browserLocalPersistence = NOT_AVAILABLE_ERROR;
export const browserSessionPersistence = NOT_AVAILABLE_ERROR;
export const indexedDBLocalPersistence = NOT_AVAILABLE_ERROR;
export const browserLocalPersistence = inMemoryPersistence;
export const browserSessionPersistence = inMemoryPersistence;
export const indexedDBLocalPersistence = inMemoryPersistence;
export const browserPopupRedirectResolver = NOT_AVAILABLE_ERROR;
export const PhoneAuthProvider = FailClass;
export const signInWithPhoneNumber = fail;
Expand Down

0 comments on commit 4d2a54f

Please sign in to comment.