비활성 유저 경고 메세지 수정
All checks were successful
Build And Test / build-and-push (push) Successful in 1m34s
All checks were successful
Build And Test / build-and-push (push) Successful in 1m34s
This commit is contained in:
@ -1,10 +1,10 @@
|
||||
// src/api/authApi.js
|
||||
import axios from 'axios';
|
||||
import { attachAuthInterceptors } from './attachInterceptors';
|
||||
import axios from "axios";
|
||||
import { attachAuthInterceptors } from "./attachInterceptors";
|
||||
|
||||
const authApi = axios.create({
|
||||
baseURL: process.env.REACT_APP_API_AUTH,
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
headers: { "Content-Type": "application/json" },
|
||||
});
|
||||
|
||||
attachAuthInterceptors(authApi);
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import React from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
|
||||
const Footer = () => {
|
||||
const navigate = useNavigate();
|
||||
@ -14,17 +14,51 @@ const Footer = () => {
|
||||
<div>
|
||||
<h4 className="text-lg font-semibold mb-4">Categories</h4>
|
||||
<ul className="space-y-2">
|
||||
<li><button onClick={() => navigate('/post/developer')} className="text-gray-400 hover:text-white">Developer</button></li>
|
||||
<li><button onClick={() => navigate('/post/systemengineer')} className="text-gray-400 hover:text-white">System Engineer</button></li>
|
||||
<li><button onClick={() => navigate('/post/etc')} className="text-gray-400 hover:text-white">Other Posts</button></li>
|
||||
<li>
|
||||
<button
|
||||
onClick={() => navigate("/post/developer")}
|
||||
className="text-gray-400 hover:text-white"
|
||||
>
|
||||
Developer
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button
|
||||
onClick={() => navigate("/post/systemengineer")}
|
||||
className="text-gray-400 hover:text-white"
|
||||
>
|
||||
System Engineer
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button
|
||||
onClick={() => navigate("/post/etc")}
|
||||
className="text-gray-400 hover:text-white"
|
||||
>
|
||||
Other Posts
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div>
|
||||
<h4 className="text-lg font-semibold mb-4">Contact</h4>
|
||||
<ul className="space-y-2 text-gray-400">
|
||||
<li className="flex items-center"><i className="fas fa-envelope mr-2"></i> icurfer@gmail.com</li>
|
||||
<li className="flex items-center"><i className="fas fa-phone mr-2"></i> -</li>
|
||||
<li className="flex items-center"><i className="fas fa-map-marker-alt mr-2"></i> -</li>
|
||||
<li className="flex items-center">
|
||||
<i className="fas fa-envelope mr-2"></i> icurfer@gmail.com
|
||||
</li>
|
||||
<li className="flex items-center">
|
||||
<i className="fas fa-phone mr-2"></i> -
|
||||
</li>
|
||||
<li className="flex items-center">
|
||||
<i className="fab fa-youtube mr-2 text-red-600"></i>
|
||||
<a
|
||||
href="https://youtube.com/@icurfer"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="flex items-center text-red-600 hover:underline"
|
||||
>icurfer</a>
|
||||
</li>
|
||||
{/* <li className="flex items-center"><i className="fas fa-map-marker-alt mr-2"></i> -</li> */}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -6,7 +6,8 @@ const Navbar = () => {
|
||||
const navigate = useNavigate();
|
||||
const { isLoggedIn, logout, user } = useAuth();
|
||||
|
||||
const menuItems = ["home", "about", "posts", "paas", "infra", "tasks"];
|
||||
// const menuItems = ["home", "about", "posts", "paas", "infra", "tasks"];
|
||||
const menuItems = ["home", "about", "posts", "tasks"];
|
||||
|
||||
return (
|
||||
<nav className="fixed w-full z-50 bg-white/90 backdrop-blur-md shadow-sm">
|
||||
|
@ -16,12 +16,18 @@ const Login = () => {
|
||||
const res = await authApi.post("/api/auth/login/", { email, password });
|
||||
|
||||
// ✅ localStorage 저장 + 전역 상태 갱신
|
||||
login(res.data); // ← access, refresh 포함된 객체
|
||||
login(res.data);
|
||||
|
||||
alert("로그인 성공");
|
||||
navigate("/");
|
||||
} catch (err) {
|
||||
const message = err.response?.data?.detail || "서버 오류";
|
||||
const data = err.response?.data;
|
||||
const message =
|
||||
data?.detail || // {"detail": "계정이 비활성화..."}
|
||||
data?.non_field_errors?.[0] || // {"non_field_errors": ["이메일 또는 비밀번호가..."]}
|
||||
Object.values(data || {})[0]?.[0] || // {"email": ["필수 입력입니다"]} 등
|
||||
"서버 오류";
|
||||
|
||||
alert("로그인 실패: " + message);
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user