Skip to content

Commit

Permalink
๐Ÿ“ Modify(#67): ์‹ค์ œ Service์—๋Š” fake jwt ์•ˆ ์˜ฌ๋ผ๊ฐ€๊ฒŒ ์ˆ˜์ •
Browse files Browse the repository at this point in the history
  • Loading branch information
bluetree7878 committed Dec 5, 2024
1 parent aec6afb commit 7bf4031
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/features/login/service/handleLogin.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
const BASE_URL = import.meta.env.VITE_BASE_URL;
import { setCookie } from '@utils/cookies';
// import { setCookie } from '@utils/cookies';

const handleLogin = (provider: 'google' | 'kakao' | 'github') => {
const redirectUrl = `${BASE_URL}/auth/${provider}`;
window.location.href = redirectUrl;

// ํ…Œ์ŠคํŠธ์šฉ JWT ์ƒ์„ฑ ๋ฐ ์ฟ ํ‚ค์— ์ €์žฅ
const fakeJwt = 'test.jwt.token';
setCookie('jwt', fakeJwt, { path: '/', maxAge: 3600 }); // 1์‹œ๊ฐ„ ์œ ํšจ
alert('JWT ์ƒ์„ฑ ์™„๋ฃŒ: ' + fakeJwt);
// const fakeJwt = 'test.jwt.token';
// setCookie('jwt', fakeJwt, { path: '/', maxAge: 3600 }); // 1์‹œ๊ฐ„ ์œ ํšจ
// alert('JWT ์ƒ์„ฑ ์™„๋ฃŒ: ' + fakeJwt);
};

export default handleLogin;
1 change: 0 additions & 1 deletion src/pages/learn/Learn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import PartNavContainer from '@features/quiz/ui/PartNavContainer';
import usePreloadImages from '@hooks/usePreloadImages';
import useUserStore from '@store/useUserStore';
import { useEffect } from 'react';
import { setCookie } from '@utils/cookies';

export default function Learn() {
const { setUser } = useUserStore();
Expand Down

0 comments on commit 7bf4031

Please sign in to comment.