fix: errors

This commit is contained in:
David Nguyen
2025-02-06 01:57:23 +11:00
parent 7effe66387
commit 738201eb55
43 changed files with 159 additions and 1068 deletions

View File

@ -5,7 +5,7 @@ import { useForm } from 'react-hook-form';
import { useNavigate } from 'react-router';
import { z } from 'zod';
import { trpc } from '@documenso/trpc/react';
import { authClient } from '@documenso/auth/client';
import { cn } from '@documenso/ui/lib/utils';
import { Button } from '@documenso/ui/primitives/button';
import {
@ -44,10 +44,10 @@ export const ForgotPasswordForm = ({ className }: ForgotPasswordFormProps) => {
const isSubmitting = form.formState.isSubmitting;
const { mutateAsync: forgotPassword } = trpc.profile.forgotPassword.useMutation();
const onFormSubmit = async ({ email }: TForgotPasswordFormSchema) => {
await forgotPassword({ email }).catch(() => null);
await authClient.emailPassword.forgotPassword({ email }).catch(() => null);
await navigate('/check-email');
toast({
title: _(msg`Reset email sent`),
@ -58,8 +58,6 @@ export const ForgotPasswordForm = ({ className }: ForgotPasswordFormProps) => {
});
form.reset();
navigate('/check-email');
};
return (

View File

@ -270,6 +270,8 @@ export const SignInForm = ({
const onSignInWithOIDCClick = async () => {
try {
// eslint-disable-next-line no-promise-executor-return
await new Promise((resolve) => setTimeout(resolve, 2000));
// await signIn('oidc', {
// callbackUrl,
// });

View File

@ -185,6 +185,7 @@ export const SignUpForm = ({
const onSignUpWithOIDCClick = async () => {
try {
// eslint-disable-next-line no-promise-executor-return
await new Promise((resolve) => setTimeout(resolve, 2000));
// await signIn('oidc', { callbackUrl: SIGN_UP_REDIRECT_PATH });
} catch (err) {

View File

@ -121,7 +121,7 @@ export function TeamBrandingPreferencesForm({ team, settings }: TeamBrandingPref
void fetch(`/api/file?key=${file.key}`, {
method: 'GET',
})
.then((res) => res.json())
.then(async (res) => await res.json())
.then((data) => {
const objectUrl = URL.createObjectURL(new Blob([data.binaryData]));