add credenza

This commit is contained in:
Milo Schwartz
2024-11-03 00:02:26 -04:00
parent a6baebb216
commit 2635443105
9 changed files with 332 additions and 29 deletions

View File

@@ -46,6 +46,7 @@ const formSchema = z
export default function SignupForm({ redirect }: SignupFormProps) {
const router = useRouter();
const [loading, setLoading] = useState(false);
const [error, setError] = useState<string | null>(null);
const form = useForm<z.infer<typeof formSchema>>({
@@ -59,6 +60,8 @@ export default function SignupForm({ redirect }: SignupFormProps) {
async function onSubmit(values: z.infer<typeof formSchema>) {
const { email, password } = values;
setLoading(true);
const res = await api
.put<AxiosResponse<SignUpResponse>>("/auth/signup", {
email,
@@ -92,6 +95,8 @@ export default function SignupForm({ redirect }: SignupFormProps) {
router.push("/");
}
}
setLoading(false);
}
return (