@@ -186,6 +223,92 @@ function UserLogin() {
+
+
+
);
}
diff --git a/src/store/features/auth/authService.tsx b/src/store/features/auth/authService.tsx
index 145092de..27330ce1 100644
--- a/src/store/features/auth/authService.tsx
+++ b/src/store/features/auth/authService.tsx
@@ -69,6 +69,13 @@ const resetPassword = async (token: string, password: string) => {
return response.data;
};
+const verifyOTP = async (userId: string, otp: string) => {
+ const response = await axiosInstance.post(
+ `/api/auth/verify-otp/${userId}`,
+ { otp }
+ );
+ return response.data;
+};
const authService = {
register,
@@ -81,6 +88,7 @@ const authService = {
googleAuthCallback,
sendResetLink,
resetPassword,
+ verifyOTP,
};
export default authService;
diff --git a/src/store/features/auth/authSlice.tsx b/src/store/features/auth/authSlice.tsx
index a2239327..b12b86b1 100644
--- a/src/store/features/auth/authSlice.tsx
+++ b/src/store/features/auth/authSlice.tsx
@@ -16,6 +16,7 @@ const initialState: AuthService = {
token: "",
isAuthenticated: false,
error: "",
+ userId: "",
};
type IUserEmailAndPassword = Pick