mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 03:23:40 +00:00
register success page
This commit is contained in:
@@ -13,6 +13,7 @@ import {
|
||||
symbolValidator,
|
||||
upperCaseValidator,
|
||||
} from "#/utils/validators";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
type Inputs =
|
||||
| {
|
||||
@@ -37,6 +38,8 @@ export default function RegisterForm({
|
||||
mode: "onBlur",
|
||||
});
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
async function submitRegister(values: Inputs) {
|
||||
const res = await fetch("/registeruser", {
|
||||
method: "POST",
|
||||
@@ -58,6 +61,12 @@ export default function RegisterForm({
|
||||
return res.json();
|
||||
}
|
||||
|
||||
function submitAndLink(value: Inputs): Promise<boolean | void> {
|
||||
return submitRegister(value).then((resp: any) => {
|
||||
return router.push(`/register/success?userid=${resp.userId}`);
|
||||
});
|
||||
}
|
||||
|
||||
const { errors } = formState;
|
||||
|
||||
const watchPassword = watch("password", "");
|
||||
@@ -168,7 +177,7 @@ export default function RegisterForm({
|
||||
!tosAndPolicyAccepted ||
|
||||
watchPassword !== watchConfirmPassword
|
||||
}
|
||||
onClick={handleSubmit(submitRegister)}
|
||||
onClick={handleSubmit(submitAndLink)}
|
||||
>
|
||||
continue
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user