first commit

This commit is contained in:
2026-08-13 18:36:31 +09:00
commit cee36bf12d
48 changed files with 4212 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
import { apiRequest } from './api.js';
export async function loadSession() {
const { user } = await apiRequest('/auth/me');
const name = document.querySelector('#profile-name');
if (name) name.textContent = user.name || user.email;
const image = document.querySelector('#profile-image');
if (image && user.picture) {
image.src = user.picture;
image.alt = `${user.name || user.email} 프로필`;
image.hidden = false;
}
return user;
}
export function bindLogout() {
document.querySelectorAll('[data-logout]').forEach((button) => {
button.addEventListener('click', async () => {
await apiRequest('/auth/logout', { method: 'POST' });
window.location.assign('/login');
});
});
}