Skip to content

Commit 2dbfe23

Browse files
peintnermaxyordis
authored andcommitted
add key to list
1 parent adc36f8 commit 2dbfe23

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

apps/login/src/components/sign-in-with-idp.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use client";
22

33
import { idpTypeToSlug } from "@/lib/idp";
4-
import { redictToIdp } from "@/lib/server/idp";
4+
import { redirectToIdp } from "@/lib/server/idp";
55
import {
66
IdentityProvider,
77
IdentityProviderType,
@@ -30,9 +30,9 @@ export function SignInWithIdp({
3030
organization,
3131
linkOnly,
3232
}: Readonly<SignInWithIDPProps>) {
33-
const [state, action, _isPending] = useActionState(redictToIdp, {});
33+
const [state, action, _isPending] = useActionState(redirectToIdp, {});
3434

35-
const renderIDPButton = (idp: IdentityProvider) => {
35+
const renderIDPButton = (idp: IdentityProvider, index: number) => {
3636
const { id, name, type } = idp;
3737

3838
const components: Partial<
@@ -56,7 +56,7 @@ export function SignInWithIdp({
5656

5757
const Component = components[type];
5858
return Component ? (
59-
<form action={action} className="flex">
59+
<form action={action} className="flex" key={`idp-${index}`}>
6060
<input type="hidden" name="id" value={id} />
6161
<input type="hidden" name="provider" value={idpTypeToSlug(type)} />
6262
<input type="hidden" name="authRequestId" value={authRequestId} />

apps/login/src/lib/server/idp.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ import { getNextUrl } from "../client";
1111
import { checkEmailVerification } from "../verify-helper";
1212
import { createSessionForIdpAndUpdateCookie } from "./cookie";
1313

14-
export type RedictToIdpState = { error?: string | null } | undefined;
14+
export type RedirectToIdpState = { error?: string | null } | undefined;
1515

16-
export async function redictToIdp(
17-
prevState: RedictToIdpState,
16+
export async function redirectToIdp(
17+
prevState: RedirectToIdpState,
1818
formData: FormData,
19-
): Promise<RedictToIdpState> {
19+
): Promise<RedirectToIdpState> {
2020
const params = new URLSearchParams();
2121

2222
const linkOnly = formData.get("linkOnly") === "true";

0 commit comments

Comments
 (0)