From b7121da36e6d14930ff1c7e00c17473298906e44 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Wed, 4 May 2022 15:04:13 -0700 Subject: [PATCH 1/2] Changeset for beforeAuthStateChanged() --- .changeset/light-poets-eat.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changeset/light-poets-eat.md diff --git a/.changeset/light-poets-eat.md b/.changeset/light-poets-eat.md new file mode 100644 index 00000000000..f3be44ce89c --- /dev/null +++ b/.changeset/light-poets-eat.md @@ -0,0 +1,7 @@ +--- +'@firebase/auth': minor +'@firebase/auth-compat': patch +--- + +Add `beforeAuthStateChanged()` middleware function which allows the user to provide callbacks that are run before an auth state change +sets a new user. From 6b10339bb1069c52d30e43030669f39d5103d7cc Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Wed, 4 May 2022 18:59:27 -0700 Subject: [PATCH 2/2] Add suggested doc text change --- packages/auth/src/model/public_types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/auth/src/model/public_types.ts b/packages/auth/src/model/public_types.ts index f92630eedae..8832f276b5b 100644 --- a/packages/auth/src/model/public_types.ts +++ b/packages/auth/src/model/public_types.ts @@ -259,7 +259,7 @@ export interface Auth { * sets a new user. * * @param callback - callback triggered before new user value is set. - * If this throws, it will block the user from being set. + * If this throws, it blocks the user from being set. */ beforeAuthStateChanged( callback: (user: User | null) => void | Promise