Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
489dd4c
refactor(core): signInWithOAuth -> signInWithProvider
Ehesp Sep 12, 2025
8036ea8
Merge branch '@invertase/align-core' of https://github.com/firebase/f…
Ehesp Sep 16, 2025
46f0710
test(react): Cleanup react testing setup
Ehesp Sep 16, 2025
1fed407
test(react): Add FirebaseUIProvider tests
Ehesp Sep 16, 2025
3ac4788
test(react): Update button tests
Ehesp Sep 16, 2025
b0fa7af
test(react): Use jest-dom matchers & improve test names
Ehesp Sep 16, 2025
0e3465f
test(react): Divider tests
Ehesp Sep 16, 2025
e929e0a
test(react): Improve country data tests
Ehesp Sep 16, 2025
db9d3ee
test(react): EmailLinkAuthScreen tests
Ehesp Sep 16, 2025
7a27cc9
test(react): ForgotPasswordAuthScreen tests
Ehesp Sep 16, 2025
3497ac0
test(react): OAuthScreen tests
Ehesp Sep 16, 2025
c471033
test(react): PhoneAuthScreen tests
Ehesp Sep 16, 2025
db7be28
test(react): SignInAuthScreen tests
Ehesp Sep 16, 2025
9a2a289
test(react): SignUpAuthScreen tests
Ehesp Sep 16, 2025
e7e91d5
test(react): OAuthButton tests
Ehesp Sep 16, 2025
00a495b
test(react): GoogleSignInButton tests
Ehesp Sep 17, 2025
f783b5f
fix(react): Remove tsconfig reference
Ehesp Sep 17, 2025
7a0cd76
chore(react): Bump tanstack form
Ehesp Sep 17, 2025
22b4b75
feat(react): Rework SignInAuthForm to new tanstack version
Ehesp Sep 17, 2025
1147348
test(react): Add form tests
Ehesp Sep 17, 2025
59f40d2
feat(react): Add additional schema hooks
Ehesp Sep 17, 2025
0d37db4
test(react): SignUpAuthForm tests
Ehesp Sep 17, 2025
8e49414
test(react): ForgotPasswordAuthForm tests
Ehesp Sep 17, 2025
b3e875e
test(react): EmailLinkAuthForm tests
Ehesp Sep 17, 2025
2fe94b5
test(react): PhoneAuthForm tests
Ehesp Sep 17, 2025
1179ab9
chore(react): Delete field info component
Ehesp Sep 17, 2025
5a80a9f
refactor(react): TanStack Form updates
dackers86 Sep 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/core/src/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export async function signInAnonymously(ui: FirebaseUIConfiguration): Promise<Us
}
}

export async function signInWithOAuth(ui: FirebaseUIConfiguration, provider: AuthProvider): Promise<void> {
export async function signInWithProvider(ui: FirebaseUIConfiguration, provider: AuthProvider): Promise<void> {
try {
if (hasBehavior(ui, "autoUpgradeAnonymousProvider")) {
await getBehavior(ui, "autoUpgradeAnonymousProvider")(ui, provider);
Expand All @@ -222,6 +222,8 @@ export async function signInWithOAuth(ui: FirebaseUIConfiguration, provider: Aut
}

ui.setState("pending");

// TODO(ehesp): Handle popup or redirect based on behavior
await signInWithRedirect(ui.auth, provider);
// We don't modify state here since the user is redirected.
// If we support popups, we'd need to modify state here.
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { deepMap, DeepMapStore, map } from "nanostores";
import { Behavior, type BehaviorHandlers, type BehaviorKey, getBehavior, hasBehavior } from "./behaviors";
import { FirebaseUIState } from "./state";

type FirebaseUIConfigurationOptions = {
export type FirebaseUIConfigurationOptions = {
app: FirebaseApp;
auth?: Auth;
locale?: RegisteredLocale;
Expand Down
8 changes: 4 additions & 4 deletions packages/core/tests/unit/auth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import {
sendSignInLinkToEmail,
signInWithEmailLink,
signInAnonymously,
signInWithOAuth,
signInWithProvider,
completeEmailLinkSignIn,
} from "../../src/auth";
import { FirebaseUIConfiguration } from "../../src/config";
Expand Down Expand Up @@ -302,11 +302,11 @@ describe("Firebase UI Auth", () => {
});
});

describe("signInWithOAuth", () => {
describe("signInWithProvider", () => {
it("should sign in with OAuth provider", async () => {
(signInWithRedirect as any).mockResolvedValue(undefined);

await signInWithOAuth(mockUi, mockProvider as any);
await signInWithProvider(mockUi, mockProvider as any);

expect(signInWithRedirect).toHaveBeenCalledWith(mockAuth, mockProvider);
});
Expand All @@ -318,7 +318,7 @@ describe("Firebase UI Auth", () => {

mockUi.behaviors.autoUpgradeAnonymousProvider = vi.fn();

await signInWithOAuth(mockUi, mockProvider as any);
await signInWithProvider(mockUi, mockProvider as any);

expect(mockUi.behaviors.autoUpgradeAnonymousProvider).toHaveBeenCalledWith(mockUi, mockProvider);
});
Expand Down
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"@firebase-ui/styles": "workspace:*",
"@nanostores/react": "^0.8.4",
"@radix-ui/react-slot": "^1.2.3",
"@tanstack/react-form": "^0.41.3",
"@tanstack/react-form": "^1.20.0",
"clsx": "^2.1.1",
"tailwind-merge": "^3.0.1",
"zod": "catalog:"
Expand Down
6 changes: 1 addition & 5 deletions packages/react/setup-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,4 @@
* limitations under the License.
*/

import { expect } from "vitest";
import * as matchers from "@testing-library/jest-dom/matchers";

// Extend Vitest's expect with jest-dom matchers
expect.extend(matchers);
import '@testing-library/jest-dom/vitest';
Loading
Loading