step 10.4: done
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user