Skip to content

Commit

Permalink
Merge pull request #198 from YAPP-Github/dev
Browse files Browse the repository at this point in the history
Release 0.1.11
  • Loading branch information
choisohyun authored Jul 30, 2022
2 parents 9b8de9b + 3916840 commit fecf52b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/pages/OauthKakao.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,18 @@ const OauthKakao = () => {
const code = new URL(window.location.href).searchParams.get('code');
const navigate = useNavigate();
useEffect(() => {
initiate();
}, []);

const initiate = async () => {
try {
const data = getToken();
const data = await getToken();
setToken(data);
navigate(Path.AuthMail);
} catch (error) {
console.log(error);
}
}, []);
};

const getToken = async () => {
const response = await client.get(`/oauth/kakao?code=${code}`);
Expand Down

0 comments on commit fecf52b

Please sign in to comment.