mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 08:47:32 +00:00
idpIntent properties
This commit is contained in:
@@ -248,6 +248,7 @@ export default async function Page(props: {
|
|||||||
if (options?.isCreationAllowed) {
|
if (options?.isCreationAllowed) {
|
||||||
return completeIDP({
|
return completeIDP({
|
||||||
branding,
|
branding,
|
||||||
|
idpIntent: { idpIntentId: id, idpIntentToken: token },
|
||||||
idpInformation,
|
idpInformation,
|
||||||
organization,
|
organization,
|
||||||
requestId,
|
requestId,
|
||||||
|
@@ -10,12 +10,17 @@ export async function completeIDP({
|
|||||||
requestId,
|
requestId,
|
||||||
organization,
|
organization,
|
||||||
branding,
|
branding,
|
||||||
|
idpIntent,
|
||||||
}: {
|
}: {
|
||||||
userId: string;
|
userId: string;
|
||||||
idpInformation: IDPInformation;
|
idpInformation: IDPInformation;
|
||||||
requestId?: string;
|
requestId?: string;
|
||||||
organization?: string;
|
organization?: string;
|
||||||
branding?: BrandingSettings;
|
branding?: BrandingSettings;
|
||||||
|
idpIntent: {
|
||||||
|
idpIntentId: string;
|
||||||
|
idpIntentToken: string;
|
||||||
|
};
|
||||||
}) {
|
}) {
|
||||||
const locale = getLocale();
|
const locale = getLocale();
|
||||||
const t = await getTranslations({ locale, namespace: "idp" });
|
const t = await getTranslations({ locale, namespace: "idp" });
|
||||||
@@ -31,6 +36,7 @@ export async function completeIDP({
|
|||||||
idpInformation={idpInformation}
|
idpInformation={idpInformation}
|
||||||
requestId={requestId}
|
requestId={requestId}
|
||||||
organization={organization}
|
organization={organization}
|
||||||
|
idpIntent={idpIntent}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</DynamicTheme>
|
</DynamicTheme>
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
|
import { registerUserAndLinkToIDP } from "@/lib/server/register";
|
||||||
import { IDPInformation } from "@zitadel/proto/zitadel/user/v2/idp_pb";
|
import { IDPInformation } from "@zitadel/proto/zitadel/user/v2/idp_pb";
|
||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
@@ -23,13 +24,20 @@ type Inputs =
|
|||||||
type Props = {
|
type Props = {
|
||||||
organization?: string;
|
organization?: string;
|
||||||
requestId?: string;
|
requestId?: string;
|
||||||
idpInformation?: IDPInformation;
|
idpIntent: {
|
||||||
|
idpIntentId: string;
|
||||||
|
idpIntentToken: string;
|
||||||
|
};
|
||||||
|
idpInformation: IDPInformation;
|
||||||
|
userId: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export function RegisterFormIDPIncomplete({
|
export function RegisterFormIDPIncomplete({
|
||||||
organization,
|
organization,
|
||||||
requestId,
|
requestId,
|
||||||
|
idpIntent,
|
||||||
idpInformation,
|
idpInformation,
|
||||||
|
userId,
|
||||||
}: Props) {
|
}: Props) {
|
||||||
const t = useTranslations("register");
|
const t = useTranslations("register");
|
||||||
|
|
||||||
@@ -51,11 +59,13 @@ export function RegisterFormIDPIncomplete({
|
|||||||
async function submitAndRegister(values: Inputs) {
|
async function submitAndRegister(values: Inputs) {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
const response = await registerUserAndLinkToIDP({
|
const response = await registerUserAndLinkToIDP({
|
||||||
|
userId: userId,
|
||||||
email: values.email,
|
email: values.email,
|
||||||
firstName: values.firstname,
|
firstName: values.firstname,
|
||||||
lastName: values.lastname,
|
lastName: values.lastname,
|
||||||
organization: organization,
|
organization: organization,
|
||||||
requestId: requestId,
|
requestId: requestId,
|
||||||
|
idpIntent: idpIntent,
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
setError("Could not register user");
|
setError("Could not register user");
|
||||||
@@ -130,7 +140,7 @@ export function RegisterFormIDPIncomplete({
|
|||||||
<Button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
variant={ButtonVariants.Primary}
|
variant={ButtonVariants.Primary}
|
||||||
disabled={loading || !formState.isValid || !tosAndPolicyAccepted}
|
disabled={loading || !formState.isValid}
|
||||||
onClick={handleSubmit(submitAndRegister)}
|
onClick={handleSubmit(submitAndRegister)}
|
||||||
data-testid="submit-button"
|
data-testid="submit-button"
|
||||||
>
|
>
|
||||||
|
Reference in New Issue
Block a user