From 2948d1b55995d976903cb95000ba9202b7bf86ea Mon Sep 17 00:00:00 2001 From: Samir Boulahtit Date: Sun, 28 Dec 2025 20:47:48 +0100 Subject: [PATCH] fix: use centralized logger in onboarding.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace console.log/error calls with onboardingLog in handleLogout function to comply with architecture rules. ๐Ÿค– Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- static/vendor/js/onboarding.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/static/vendor/js/onboarding.js b/static/vendor/js/onboarding.js index 3c5828af..2e16608a 100644 --- a/static/vendor/js/onboarding.js +++ b/static/vendor/js/onboarding.js @@ -605,7 +605,7 @@ function vendorOnboarding(initialLang = 'en') { // Logout handler async handleLogout() { - console.log('๐Ÿšช Logging out from onboarding...'); + onboardingLog.info('Logging out from onboarding...'); // Get vendor code from URL const path = window.location.pathname; @@ -615,19 +615,19 @@ function vendorOnboarding(initialLang = 'en') { try { // Call logout API await apiClient.post('/vendor/auth/logout'); - console.log('โœ… Logout API called successfully'); + onboardingLog.info('Logout API called successfully'); } catch (error) { - console.error('โš ๏ธ Logout API error (continuing anyway):', error); + onboardingLog.warn('Logout API error (continuing anyway):', error); } finally { // Clear vendor tokens only (not admin or customer tokens) - console.log('๐Ÿงน Clearing vendor tokens...'); + onboardingLog.info('Clearing vendor tokens...'); localStorage.removeItem('vendor_token'); localStorage.removeItem('vendor_user'); localStorage.removeItem('currentUser'); localStorage.removeItem('vendorCode'); // Note: Do NOT use localStorage.clear() - it would clear admin/customer tokens too - console.log('๐Ÿ”„ Redirecting to login...'); + onboardingLog.info('Redirecting to login...'); window.location.href = `/vendor/${vendorCode}/login`; } },