mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 06:42:59 +00:00
back button, error handling
This commit is contained in:
@@ -55,13 +55,13 @@ export default function ChangePasswordForm({
|
|||||||
userId: userId,
|
userId: userId,
|
||||||
password: values.password,
|
password: values.password,
|
||||||
}).catch((error: Error) => {
|
}).catch((error: Error) => {
|
||||||
setError(error.message ?? "Could not register user");
|
setError(error.message ?? "Could not change password");
|
||||||
});
|
});
|
||||||
|
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
|
|
||||||
if (!response) {
|
if (!response) {
|
||||||
setError("Could not register user");
|
setError("Could not change password");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -89,9 +89,7 @@ export default function RegisterFormWithoutPassword({
|
|||||||
if (withPassword) {
|
if (withPassword) {
|
||||||
return router.push(`/register?` + new URLSearchParams(registerParams));
|
return router.push(`/register?` + new URLSearchParams(registerParams));
|
||||||
} else {
|
} else {
|
||||||
const session = await submitAndRegister(value).catch((error) => {
|
const session = await submitAndRegister(value);
|
||||||
setError(error.message ?? "Could not register user");
|
|
||||||
});
|
|
||||||
|
|
||||||
const params = new URLSearchParams({});
|
const params = new URLSearchParams({});
|
||||||
if (session?.factors?.user?.loginName) {
|
if (session?.factors?.user?.loginName) {
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import { useRouter } from "next/navigation";
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { FieldValues, useForm } from "react-hook-form";
|
import { FieldValues, useForm } from "react-hook-form";
|
||||||
import Alert from "./Alert";
|
import Alert from "./Alert";
|
||||||
|
import BackButton from "./BackButton";
|
||||||
import { Button, ButtonVariants } from "./Button";
|
import { Button, ButtonVariants } from "./Button";
|
||||||
import { TextInput } from "./Input";
|
import { TextInput } from "./Input";
|
||||||
import PasswordComplexity from "./PasswordComplexity";
|
import PasswordComplexity from "./PasswordComplexity";
|
||||||
@@ -150,9 +151,7 @@ export default function SetPasswordForm({
|
|||||||
{error && <Alert>{error}</Alert>}
|
{error && <Alert>{error}</Alert>}
|
||||||
|
|
||||||
<div className="mt-8 flex w-full flex-row items-center justify-between">
|
<div className="mt-8 flex w-full flex-row items-center justify-between">
|
||||||
<Button type="button" variant={ButtonVariants.Secondary}>
|
<BackButton />
|
||||||
back
|
|
||||||
</Button>
|
|
||||||
<Button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
variant={ButtonVariants.Primary}
|
variant={ButtonVariants.Primary}
|
||||||
|
|||||||
Reference in New Issue
Block a user