@@ -2149,7 +2085,7 @@
// État utilisateur et authentification
let currentUser = {
- isLoggedIn: false,
+ isLoggedIn: true,
firstName: "Christophe",
lastName: "Vigneron",
email: "christophe.vigneron@email.com",
@@ -2615,23 +2551,6 @@
`;
}
- } else {
- if (greeting) greeting.innerHTML = `Bonjour, Visiteur !`;
- if (guestBanner) guestBanner.classList.remove('hidden');
- if (container) {
- container.innerHTML = `
-
- `;
- }
- if (desktopContainer) {
- desktopContainer.innerHTML = `
-
- `;
- }
}
}
@@ -5094,25 +5013,6 @@
modal.classList.remove('flex');
}
- function switchAuthTab(tab) {
- const loginTab = document.getElementById('auth-tab-login');
- const regTab = document.getElementById('auth-tab-register');
- const loginForm = document.getElementById('auth-form-login');
- const regForm = document.getElementById('auth-form-register');
-
- if (tab === 'login') {
- loginTab.className = "flex-1 py-2.5 text-xs font-bold rounded-xl bg-job-sage text-white transition-all";
- regTab.className = "flex-1 py-2.5 text-xs font-bold rounded-xl text-gray-500 hover:text-job-dark transition-all";
- loginForm.classList.remove('hidden');
- regForm.classList.add('hidden');
- } else {
- regTab.className = "flex-1 py-2.5 text-xs font-bold rounded-xl bg-job-sage text-white transition-all";
- loginTab.className = "flex-1 py-2.5 text-xs font-bold rounded-xl text-gray-500 hover:text-job-dark transition-all";
- regForm.classList.remove('hidden');
- loginForm.classList.add('hidden');
- }
- }
-
function checkAgeRequirement() {
// Inscription libre sans blocage d'âge
}
@@ -5150,57 +5050,6 @@
}, 1800);
}
- function loginAsChristophe() {
- currentUser.isLoggedIn = true;
- currentUser.firstName = "Christophe";
- currentUser.lastName = "Vigneron";
- currentUser.email = "christophe.vigneron@email.com";
- currentUser.idVerified = true;
- saveSession();
- renderHeaderAuth();
- updateProfilePassUI();
- updateMessagesNotification();
- closeAuthModal();
- triggerCustomModal("Ravi de vous revoir, Christophe !", "check");
- navigate('profile');
- }
- const loginAsNils = loginAsChristophe;
-
- function handleCustomLogin(e) {
- e.preventDefault();
- const identifierInput = document.getElementById('login-identifier');
- const identifier = identifierInput ? identifierInput.value.trim() : '';
- if (!identifier) return;
-
- let fName = "Alex";
- let lName = "Dupont";
- if (identifier.includes('@')) {
- const parts = identifier.split('@')[0].split('.');
- fName = parts[0].charAt(0).toUpperCase() + parts[0].slice(1);
- if (parts.length > 1) {
- lName = parts[1].charAt(0).toUpperCase() + parts[1].slice(1);
- }
- } else if (/^\d+$/.test(identifier.replace(/[\s\-\.]/g, ''))) {
- fName = "Utilisateur";
- lName = "Mobile";
- }
-
- currentUser.isLoggedIn = true;
- currentUser.firstName = fName;
- currentUser.lastName = lName;
- currentUser.email = identifier.includes('@') ? identifier : `${identifier}@jobrunner.app`;
- currentUser.idVerified = true;
- currentUser.avatar = "https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=150&auto=format&fit=crop&q=80";
-
- saveSession();
- renderHeaderAuth();
- updateProfilePassUI();
- updateMessagesNotification();
- closeAuthModal();
- triggerCustomModal(`Connexion réussie ! Ravi de vous revoir, ${currentUser.firstName}.`, "check");
- navigate('home');
- }
-
function handleKycRegister(e) {
e.preventDefault();
@@ -5236,16 +5085,6 @@
navigate('profile');
}
- function handleLogout() {
- currentUser.isLoggedIn = false;
- currentUser.idVerified = false;
- clearSession();
- renderHeaderAuth();
- updateMessagesNotification();
- triggerCustomModal("Déconnexion réussie. Vous naviguez en mode invité.", "info");
- navigate('home');
- }
-
// ====== SESSION PERSISTENCE (localStorage + token 24h) ======
function saveSession() {
try {