Skip to content

Commit 5f46b63

Browse files
committed
chore: Update with main changes
1 parent 49a52e2 commit 5f46b63

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

packages/core/src/auth.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,6 +1001,7 @@ describe("signInWithCustomToken", () => {
10011001

10021002
const result = await signInWithCustomToken(mockUI, customToken);
10031003

1004+
expect(mockUI.setRedirectError).toHaveBeenCalledWith(undefined);
10041005
expect(vi.mocked(mockUI.setState).mock.calls).toEqual([["pending"], ["idle"]]);
10051006

10061007
expect(_signInWithCustomToken).toHaveBeenCalledWith(mockUI.auth, customToken);
@@ -1018,6 +1019,7 @@ describe("signInWithCustomToken", () => {
10181019

10191020
await signInWithCustomToken(mockUI, customToken);
10201021

1022+
expect(mockUI.setRedirectError).toHaveBeenCalledWith(undefined);
10211023
expect(handleFirebaseError).toHaveBeenCalledWith(mockUI, error);
10221024

10231025
expect(vi.mocked(mockUI.setState).mock.calls).toEqual([["pending"], ["idle"]]);
@@ -1032,6 +1034,8 @@ describe("signInWithCustomToken", () => {
10321034

10331035
await signInWithCustomToken(mockUI, customToken);
10341036

1037+
// Verify redirect error is cleared even when network error occurs
1038+
expect(mockUI.setRedirectError).toHaveBeenCalledWith(undefined);
10351039
expect(handleFirebaseError).toHaveBeenCalledWith(mockUI, error);
10361040

10371041
expect(vi.mocked(mockUI.setState).mock.calls).toEqual([["pending"], ["idle"]]);
@@ -1046,6 +1050,8 @@ describe("signInWithCustomToken", () => {
10461050

10471051
await signInWithCustomToken(mockUI, customToken);
10481052

1053+
// Verify redirect error is cleared even when token is expired
1054+
expect(mockUI.setRedirectError).toHaveBeenCalledWith(undefined);
10491055
expect(handleFirebaseError).toHaveBeenCalledWith(mockUI, error);
10501056

10511057
expect(vi.mocked(mockUI.setState).mock.calls).toEqual([["pending"], ["idle"]]);

packages/core/src/auth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ export async function signInWithCredential(ui: FirebaseUI, credential: AuthCrede
257257

258258
export async function signInWithCustomToken(ui: FirebaseUI, customToken: string): Promise<UserCredential> {
259259
try {
260-
ui.setState("pending");
260+
setPendingState(ui);
261261
const result = await _signInWithCustomToken(ui.auth, customToken);
262262
return handlePendingCredential(ui, result);
263263
} catch (error) {

0 commit comments

Comments
 (0)