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:
@@ -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 || '알 수 없는 오류가 발생했습니다.');
|
||||
|
||||
Reference in New Issue
Block a user