Skip to content

Commit

Permalink
fix: 팝업 종료 실험
Browse files Browse the repository at this point in the history
  • Loading branch information
jikwan0327 committed Sep 17, 2023
1 parent 9d40834 commit eee1943
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/components/Pass.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { useToken } from '@/hooks/useToken';
import { getQueryValues } from '@/utils/getQueryValues';
import { useEffect } from 'react';
import { useNavigate } from 'react-router';

export const Pass = () => {
const moduleToken = getQueryValues().get('mdl_tkn');
Expand All @@ -15,6 +17,15 @@ export const Pass = () => {
}
}, [moduleToken]);

const { clearToken } = useToken();
const navigate = useNavigate();
useEffect(() => {
window.addEventListener('beforeunload', () => {
clearToken();
// navigate('/login');
});
}, [clearToken, navigate]);

if (!moduleToken) return null;
return (
<form
Expand Down

0 comments on commit eee1943

Please sign in to comment.