step 10.4: done

This commit is contained in:
bepis
2026-10-22 22:55:24 +11:00
parent 441efb06bd
commit 81ad47c138
5 changed files with 187 additions and 16 deletions
+10
View File
@@ -1,4 +1,14 @@
document.addEventListener('DOMContentLoaded', () => {
// If user already has a hero, redirect to game page
api.get('/auth/me').then((data) => {
if (data.hasHero) {
window.location.href = '/game.html';
return;
}
}).catch(() => {
// Not logged in or error — stay on page (login form will show)
});
const form = document.getElementById('create-hero-form');
if (!form) return;