Skip to content

Commit f796e1c

Browse files
refactor(RightSide): comment out GitHub callback handling for future implementation
1 parent d930b9a commit f796e1c

1 file changed

Lines changed: 46 additions & 46 deletions

File tree

src/components/Auth/RightSide.jsx

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -206,41 +206,41 @@ export const RightSide = () => {
206206
}
207207
}, [isGitHubAuth, githubAuth]);
208208

209-
const handleGitHubCallback = useCallback(
210-
async (code) => {
211-
setIsProcessingGitHubCallback(true);
212-
213-
try {
214-
const response = await axiosInstance.get(
215-
`/auth/github/callback?code=${code}`,
216-
{
217-
withCredentials: true,
218-
}
219-
);
220-
console.log("GitHub callback response:--------", response);
221-
const data = response?.data;
222-
const user = response?.data?.data;
223-
224-
// const authCheck = await checkAuth();
225-
if (isLoggedIn) {
226-
const destination = user?.is_signedup ? "/onboarding" : "/dashboard";
227-
navigate(destination);
228-
toast.success(
229-
data?.message || "Successfully authenticated with GitHub"
230-
);
231-
}
232-
} catch (error) {
233-
console.error("GitHub callback error:", error);
234-
toast.error(
235-
error.response?.data?.errors ||
236-
"Failed to authenticate with GitHub. Please try again."
237-
);
238-
} finally {
239-
setIsProcessingGitHubCallback(false);
240-
}
241-
},
242-
[checkAuth, isLoggedIn]
243-
);
209+
// const handleGitHubCallback = useCallback(
210+
// async (code) => {
211+
// setIsProcessingGitHubCallback(true);
212+
213+
// try {
214+
// const response = await axiosInstance.get(
215+
// `/auth/github/callback?code=${code}`,
216+
// {
217+
// withCredentials: true,
218+
// }
219+
// );
220+
// console.log("GitHub callback response:--------", response);
221+
// const data = response?.data;
222+
// const user = response?.data?.data;
223+
224+
// // const authCheck = await checkAuth();
225+
// if (isLoggedIn) {
226+
// const destination = user?.is_signedup ? "/onboarding" : "/dashboard";
227+
// navigate(destination);
228+
// toast.success(
229+
// data?.message || "Successfully authenticated with GitHub"
230+
// );
231+
// }
232+
// } catch (error) {
233+
// console.error("GitHub callback error:", error);
234+
// toast.error(
235+
// error.response?.data?.errors ||
236+
// "Failed to authenticate with GitHub. Please try again."
237+
// );
238+
// } finally {
239+
// setIsProcessingGitHubCallback(false);
240+
// }
241+
// },
242+
// [checkAuth, isLoggedIn]
243+
// );
244244

245245
// === EFFECTS ===
246246
// useEffect(() => {
@@ -270,18 +270,18 @@ export const RightSide = () => {
270270
withCredentials: true,
271271
})
272272
.then((d) => d?.data);
273-
setTimeout(async () => {
274-
var check = await checkAuth();
275-
if (axres?.data?.is_signedup) {
276-
if (check.status) {
277-
navigate("/onboarding");
278-
}
279-
} else {
280-
if (check.status) {
281-
navigate("/dashboard");
282-
}
273+
// setTimeout(async () => {
274+
var check = await checkAuth();
275+
if (axres?.data?.is_signedup) {
276+
if (check.status) {
277+
navigate("/onboarding");
278+
}
279+
} else {
280+
if (check.status) {
281+
navigate("/dashboard");
283282
}
284-
}, 1000);
283+
}
284+
// }, 1000);
285285
} catch (error) {
286286
console.error("GitHub auth error:", error);
287287
setIsProcessingGitHubCallback(false);

0 commit comments

Comments
 (0)