Fix: Correct signUp type definition

The signUp function in AuthContextType was expecting only two arguments (email, password) but the RegisterForm component was passing three arguments (email, password, username). This commit updates the AuthContextType definition to match the actual usage in the RegisterForm component, resolving the TypeScript error.
This commit is contained in:
gpt-engineer-app[bot]
2025-03-15 15:18:01 +00:00
parent 3c96a9deac
commit 0f07edaa98
3 changed files with 17 additions and 9 deletions

View File

@@ -1,4 +1,3 @@
import React, { useState } from "react";
import { useNavigate } from "react-router-dom";
import { Label } from "@/components/ui/label";
@@ -9,7 +8,7 @@ import { useToast } from "@/hooks/useToast.wrapper";
import { verifyServerConnection } from "@/contexts/auth/auth.utils";
interface RegisterFormProps {
signUp: (email: string, password: string) => Promise<{
signUp: (email: string, password: string, username: string) => Promise<{
error: any;
user: any;
}>;
@@ -88,7 +87,7 @@ const RegisterForm: React.FC<RegisterFormProps> = ({
setIsLoading(true);
try {
const { error, user } = await signUp(email, password);
const { error, user } = await signUp(email, password, username);
if (error) {
setRegisterError(error.message || '알 수 없는 오류가 발생했습니다.');