File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,11 @@ import {
8
8
RefreshTokenSchema ,
9
9
TokenPairResponseSchema ,
10
10
} from "@/types/Token" ;
11
- import { LoginCredentials , SignupData } from "@/types/AuthCredentials" ;
11
+ import {
12
+ LoginCredentials ,
13
+ SignupData ,
14
+ SignupDataSchema ,
15
+ } from "@/types/AuthCredentials" ;
12
16
import { LogoutResponse , LogoutResposeSchema } from "@/types/AuthResponses" ;
13
17
import { getAccessToken } from "@/lib/auth" ;
14
18
@@ -61,6 +65,7 @@ export async function signup(
61
65
signupData : SignupData
62
66
) : Promise < AccessTokenResponse > {
63
67
try {
68
+ const parsedSignupData = SignupDataSchema . parse ( signupData ) ;
64
69
const res : Response = await fetch (
65
70
process . env . PUBLIC_API_URL + `/api/auth/local/signup` ,
66
71
{
@@ -69,7 +74,7 @@ export async function signup(
69
74
headers : {
70
75
"Content-Type" : "application/json" ,
71
76
} ,
72
- body : JSON . stringify ( signupData ) ,
77
+ body : JSON . stringify ( parsedSignupData ) ,
73
78
}
74
79
) ;
75
80
You can’t perform that action at this time.
0 commit comments