Skip to content

Commit

Permalink
fix: oauth sign in (#614)
Browse files Browse the repository at this point in the history
  • Loading branch information
chiol authored Aug 8, 2024
1 parent 5da22ad commit 6353284
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,11 @@ export const useOAuthCallback = () => {
const router = useRouter();

const query = useMemo(() => {
if (!router.query.callback_url) return null;
const { code, callback_url } = router.query;

return code ? ({ code, callback_url } as IQuery) : null;
return { code, callback_url } as IQuery;
}, [router.query]);

useEffect(() => {
if (!query) return;
signInWithOAuth(query).catch(() => {
toast.negative({ title: 'OAuth2.0 Login Error' });
void router.replace(Path.SIGN_IN);
Expand Down

0 comments on commit 6353284

Please sign in to comment.