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