fromis_9/frontend/src/api/admin/auth.js
caadiq 980ae3fe1d refactor: frontend-temp를 frontend로 대체 및 문서 업데이트
- frontend 폴더를 새로 리팩토링된 frontend-temp로 교체
- docs/architecture.md: 현재 프로젝트 구조 반영
- docs/development.md: API 클라이언트 구조 업데이트
- docs/frontend-improvement.md 삭제 (완료된 개선 계획)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 10:29:30 +09:00

37 lines
915 B
JavaScript

/**
* 관리자 인증 API
*/
import { fetchApi, fetchAuthApi } from '@/api/client';
/**
* 로그인
* @param {string} username - 사용자명
* @param {string} password - 비밀번호
* @returns {Promise<{token: string, user: object}>}
*/
export async function login(username, password) {
return fetchApi('/auth/login', {
method: 'POST',
body: JSON.stringify({ username, password }),
});
}
/**
* 토큰 검증
* @returns {Promise<{valid: boolean, user: object}>}
*/
export async function verifyToken() {
return fetchAuthApi('/auth/verify');
}
/**
* 비밀번호 변경
* @param {string} currentPassword - 현재 비밀번호
* @param {string} newPassword - 새 비밀번호
*/
export async function changePassword(currentPassword, newPassword) {
return fetchAuthApi('/auth/change-password', {
method: 'POST',
body: JSON.stringify({ currentPassword, newPassword }),
});
}