mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-13 12:12:57 +00:00
register callback
This commit is contained in:
@@ -4,8 +4,15 @@ import VerifyEmailForm from "#/ui/VerifyEmailForm";
|
|||||||
import { ExclamationTriangleIcon } from "@heroicons/react/24/outline";
|
import { ExclamationTriangleIcon } from "@heroicons/react/24/outline";
|
||||||
|
|
||||||
export default async function Page({ searchParams }: { searchParams: any }) {
|
export default async function Page({ searchParams }: { searchParams: any }) {
|
||||||
const { userID, code, submit, organization, loginname, passwordset } =
|
const {
|
||||||
searchParams;
|
userID,
|
||||||
|
code,
|
||||||
|
submit,
|
||||||
|
organization,
|
||||||
|
authRequestId,
|
||||||
|
loginname,
|
||||||
|
passwordset,
|
||||||
|
} = searchParams;
|
||||||
|
|
||||||
const branding = await getBrandingSettings(server, organization);
|
const branding = await getBrandingSettings(server, organization);
|
||||||
|
|
||||||
@@ -23,6 +30,7 @@ export default async function Page({ searchParams }: { searchParams: any }) {
|
|||||||
code={code}
|
code={code}
|
||||||
submit={submit === "true"}
|
submit={submit === "true"}
|
||||||
organization={organization}
|
organization={organization}
|
||||||
|
authRequestId={authRequestId}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<div className="w-full flex flex-row items-center justify-center border border-yellow-600/40 dark:border-yellow-500/20 bg-yellow-200/30 text-yellow-600 dark:bg-yellow-700/20 dark:text-yellow-200 rounded-md py-2 scroll-px-40">
|
<div className="w-full flex flex-row items-center justify-center border border-yellow-600/40 dark:border-yellow-500/20 bg-yellow-200/30 text-yellow-600 dark:bg-yellow-700/20 dark:text-yellow-200 rounded-md py-2 scroll-px-40">
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import {
|
|||||||
} from "#/utils/validators";
|
} from "#/utils/validators";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { Spinner } from "./Spinner";
|
import { Spinner } from "./Spinner";
|
||||||
|
import { AuthRequest } from "@zitadel/server";
|
||||||
|
|
||||||
type Inputs =
|
type Inputs =
|
||||||
| {
|
| {
|
||||||
@@ -33,12 +34,14 @@ type Props = {
|
|||||||
legal: LegalAndSupportSettings;
|
legal: LegalAndSupportSettings;
|
||||||
passwordComplexitySettings: PasswordComplexitySettings;
|
passwordComplexitySettings: PasswordComplexitySettings;
|
||||||
organization?: string;
|
organization?: string;
|
||||||
|
authRequestId?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function RegisterForm({
|
export default function RegisterForm({
|
||||||
legal,
|
legal,
|
||||||
passwordComplexitySettings,
|
passwordComplexitySettings,
|
||||||
organization,
|
organization,
|
||||||
|
authRequestId,
|
||||||
}: Props) {
|
}: Props) {
|
||||||
const { register, handleSubmit, watch, formState } = useForm<Inputs>({
|
const { register, handleSubmit, watch, formState } = useForm<Inputs>({
|
||||||
mode: "onBlur",
|
mode: "onBlur",
|
||||||
@@ -81,6 +84,10 @@ export default function RegisterForm({
|
|||||||
params.organization = organization;
|
params.organization = organization;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (authRequestId) {
|
||||||
|
params.authRequestId = authRequestId;
|
||||||
|
}
|
||||||
|
|
||||||
return router.push(`/verify?` + new URLSearchParams(params));
|
return router.push(`/verify?` + new URLSearchParams(params));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ type Props = {
|
|||||||
code: string;
|
code: string;
|
||||||
submit: boolean;
|
submit: boolean;
|
||||||
organization?: string;
|
organization?: string;
|
||||||
|
authRequestId?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function VerifyEmailForm({
|
export default function VerifyEmailForm({
|
||||||
@@ -24,6 +25,7 @@ export default function VerifyEmailForm({
|
|||||||
code,
|
code,
|
||||||
submit,
|
submit,
|
||||||
organization,
|
organization,
|
||||||
|
authRequestId,
|
||||||
}: Props) {
|
}: Props) {
|
||||||
const { register, handleSubmit, formState } = useForm<Inputs>({
|
const { register, handleSubmit, formState } = useForm<Inputs>({
|
||||||
mode: "onBlur",
|
mode: "onBlur",
|
||||||
|
|||||||
Reference in New Issue
Block a user