Test: 리프레시 토큰 재발급 테스트 완료 후 제거

This commit is contained in:
정현조 2024-09-19 08:18:22 +09:00
parent 889cf872d0
commit 2da76c1bf3

View File

@ -3,7 +3,7 @@ import { Link } from 'react-router-dom';
import GoogleLogo from '@/assets/icons/web_neutral_rd_ctn@1x.png'; import GoogleLogo from '@/assets/icons/web_neutral_rd_ctn@1x.png';
import useAuthStore from '@/stores/useAuthStore'; import useAuthStore from '@/stores/useAuthStore';
import { Button } from '@/components/ui/button'; import { Button } from '@/components/ui/button';
import { getProfile, reissueToken } from '@/api/authApi'; import { getProfile } from '@/api/authApi';
const BASE_URL = import.meta.env.VITE_API_URL; const BASE_URL = import.meta.env.VITE_API_URL;
export default function Home() { export default function Home() {
@ -20,18 +20,6 @@ export default function Home() {
const handleGoogleSignIn = () => { const handleGoogleSignIn = () => {
window.location.href = `${BASE_URL}/api/login/oauth2/authorization/google`; window.location.href = `${BASE_URL}/api/login/oauth2/authorization/google`;
}; };
const handleReissueToken = async () => {
try {
const response = await reissueToken();
console.log('토큰 재발급 성공:', response);
alert('토큰 재발급 성공! 새로운 액세스 토큰을 콘솔에서 확인하세요.');
} catch (error) {
console.error('토큰 재발급 실패:', error);
alert('토큰 재발급에 실패했습니다. 다시 시도해 주세요.');
}
};
const isHidden = true;
return ( return (
<div className="flex h-full flex-col items-center justify-center bg-gray-50 p-8"> <div className="flex h-full flex-col items-center justify-center bg-gray-50 p-8">
@ -85,15 +73,6 @@ export default function Home() {
> >
<Link to="/browse"></Link> <Link to="/browse"></Link>
</Button> </Button>
<Button
variant="outlinePrimary"
size="lg"
onClick={handleReissueToken}
className="mt-4"
style={{ display: isHidden ? 'none' : 'block' }}
>
</Button>
</> </>
)} )}
</div> </div>