diff --git a/frontend/src/hooks/useAuth.ts b/frontend/src/hooks/useAuth.ts index 8a628b6..fbf9f0e 100644 --- a/frontend/src/hooks/useAuth.ts +++ b/frontend/src/hooks/useAuth.ts @@ -19,10 +19,11 @@ export function useAuth() { }, []) const login = async (username: string, password: string) => { - const params = new URLSearchParams({ username, password }) - const r = await guardiaApi.post('/api/auth/login', params, { - headers: { 'Content-Type': 'application/x-www-form-urlencoded' } - }) + // JSON 방식 (ITSM은 JSON 로그인만 지원) + const r = await guardiaApi.post('/api/auth/login', + { username, password }, + { headers: { 'Content-Type': 'application/json' } } + ) const { access_token } = r.data sessionStorage.setItem('gm_token', access_token) const me = await guardiaApi.get('/api/auth/me')