- SSAFY OAuth state 파라미터 전달 추가 (로그인 불능 해결) - POST/PUT/DELETE 5xx 및 네트워크 에러 재시도 방지 (멱등 요청만 재시도) - UserAdmin 페이지네이션 추가 (offset/limit) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
41 lines
1.1 KiB
JavaScript
41 lines
1.1 KiB
JavaScript
import { apiFetch } from './client';
|
|
|
|
export async function login(username, password) {
|
|
return apiFetch('/api/auth/login', {
|
|
method: 'POST',
|
|
body: JSON.stringify({ username, password }),
|
|
});
|
|
}
|
|
|
|
export async function register(username, password) {
|
|
return apiFetch('/api/auth/register', {
|
|
method: 'POST',
|
|
body: JSON.stringify({ username, password }),
|
|
});
|
|
}
|
|
|
|
export async function logout() {
|
|
return apiFetch('/api/auth/logout', { method: 'POST' });
|
|
}
|
|
|
|
export async function getSSAFYLoginURL() {
|
|
return apiFetch('/api/auth/ssafy/login');
|
|
}
|
|
|
|
export async function ssafyCallback(code, state) {
|
|
return apiFetch('/api/auth/ssafy/callback', {
|
|
method: 'POST',
|
|
body: JSON.stringify({ code, state }),
|
|
});
|
|
}
|
|
|
|
// 토큰을 리프레시하고 새 access token을 반환 (동시 호출 방지 포함)
|
|
export { tryRefresh as refreshToken } from './client';
|
|
|
|
// 게임 런처용 일회용 티켓 발급 (JWT를 URL에 노출하지 않기 위해 사용)
|
|
export async function createLaunchTicket() {
|
|
const data = await apiFetch('/api/auth/launch-ticket', { method: 'POST' });
|
|
return data.ticket;
|
|
}
|
|
|