fix: use centralized logger in onboarding.js
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 <noreply@anthropic.com>
This commit is contained in:
10
static/vendor/js/onboarding.js
vendored
10
static/vendor/js/onboarding.js
vendored
@@ -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`;
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user