Skip to content

Commit 4484b9d

Browse files
peppescgclaude
andcommitted
Use static "Sign in" button text instead of provider name
The sign-in button was deriving its text from OIDC_PROVIDER_ID (showing "Oidc" after hardcoding). Replace with static "Sign in" text and remove the Okta icon, matching the enterprise implementation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent fa354e6 commit 4484b9d

2 files changed

Lines changed: 11 additions & 18 deletions

File tree

src/app/signin/__tests__/signin.test.tsx

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ describe("SignInPage", () => {
2929
screen.getByText(/Sign in using your company credentials/i),
3030
).toBeDefined();
3131

32-
expect(screen.getByRole("button", { name: /Oidc/i })).toBeDefined();
32+
expect(screen.getByRole("button", { name: /Sign in/i })).toBeDefined();
3333
});
3434

3535
test("calls authClient.signIn.oauth2 when button is clicked", async () => {
@@ -41,7 +41,7 @@ describe("SignInPage", () => {
4141

4242
render(<SignInPage />);
4343

44-
const signInButton = screen.getByRole("button", { name: /Oidc/i });
44+
const signInButton = screen.getByRole("button", { name: /Sign in/i });
4545
await user.click(signInButton);
4646

4747
await waitFor(() => {
@@ -62,7 +62,7 @@ describe("SignInPage", () => {
6262

6363
render(<SignInPage />);
6464

65-
const signInButton = screen.getByRole("button", { name: /Oidc/i });
65+
const signInButton = screen.getByRole("button", { name: /Sign in/i });
6666
await user.click(signInButton);
6767

6868
await waitFor(() => {
@@ -80,7 +80,7 @@ describe("SignInPage", () => {
8080

8181
render(<SignInPage />);
8282

83-
const signInButton = screen.getByRole("button", { name: /Oidc/i });
83+
const signInButton = screen.getByRole("button", { name: /Sign in/i });
8484
await user.click(signInButton);
8585

8686
await waitFor(() => {
@@ -98,7 +98,7 @@ describe("SignInPage", () => {
9898

9999
render(<SignInPage />);
100100

101-
const signInButton = screen.getByRole("button", { name: /Oidc/i });
101+
const signInButton = screen.getByRole("button", { name: /Sign in/i });
102102
await user.click(signInButton);
103103

104104
await waitFor(() => {
@@ -124,7 +124,7 @@ describe("SignInPage", () => {
124124
});
125125

126126
render(<SignInPage />);
127-
await user.click(screen.getByRole("button", { name: /Oidc/i }));
127+
await user.click(screen.getByRole("button", { name: /Sign in/i }));
128128

129129
await waitFor(() => {
130130
expect(authClient.signOut).toHaveBeenCalledOnce();
@@ -133,7 +133,7 @@ describe("SignInPage", () => {
133133
});
134134
});
135135

136-
test("signin with okta provider", async () => {
136+
test("signin with custom provider id", async () => {
137137
const user = userEvent.setup();
138138
vi.mocked(authClient.signIn.oauth2).mockResolvedValue({
139139
data: { url: "http://example.com", redirect: true },
@@ -142,10 +142,9 @@ describe("SignInPage", () => {
142142

143143
render(<SignInButton providerId="okta" />);
144144

145-
expect(screen.getByRole("button", { name: "Okta" })).toBeDefined();
146-
147-
const oktaButton = screen.getByRole("button", { name: /Okta/i });
148-
await user.click(oktaButton);
145+
// Button always shows "Sign in" regardless of provider ID
146+
const signInButton = screen.getByRole("button", { name: /Sign in/i });
147+
await user.click(signInButton);
149148

150149
await waitFor(() => {
151150
expect(authClient.signIn.oauth2).toHaveBeenCalledWith({

src/app/signin/signin-button.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,11 @@
22
import { Loader2 } from "lucide-react";
33
import { useState } from "react";
44
import { toast } from "sonner";
5-
import { OktaIcon } from "@/components/brand-icons";
65
import { Button } from "@/components/ui/button";
76
import { authClient } from "@/lib/auth/auth-client";
87

98
export function SignInButton({ providerId }: { providerId: string }) {
109
const [isLoading, setIsLoading] = useState(false);
11-
const isOktaProvider = providerId === "okta" || providerId === "oidc";
12-
const providerName = providerId.charAt(0).toUpperCase() + providerId.slice(1);
1310

1411
const handleOIDCSignIn = async () => {
1512
setIsLoading(true);
@@ -59,10 +56,7 @@ export function SignInButton({ providerId }: { providerId: string }) {
5956
{isLoading ? (
6057
<Loader2 className="text-muted-foreground size-4 animate-spin" />
6158
) : (
62-
<>
63-
{isOktaProvider && <OktaIcon className="size-4 shrink-0" />}
64-
<span>{providerName}</span>
65-
</>
59+
"Sign in"
6660
)}
6761
</Button>
6862
);

0 commit comments

Comments
 (0)