From 05ffef32ed14a80c26a9965f88f4015956d8358b Mon Sep 17 00:00:00 2001 From: vickytechkey Date: Mon, 10 Aug 2026 18:02:20 +0530 Subject: [PATCH] fixing the logout isssue --- src/App.tsx | 46 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/src/App.tsx b/src/App.tsx index 86f3a56..4c72f80 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -236,6 +236,50 @@ export default function App() { window.scrollTo({ top: 0, behavior: 'smooth' }) } + const handleLogout = () => { + apiFetch(`${CONFIG.apiBaseUrl}/api/auth/logout/`, { + method: 'POST', + headers: { 'Content-Type': 'application/json' } + }) + .catch(err => console.error('Error logging out:', err)) + .finally(() => { + // Reset all onboarding & profile states to their defaults + setIsProfileComplete(false) + setProfileStep(1) + setEmail('') + setPhone('') + setPassword('') + setConfirmPassword('') + setPolicyAccepted(false) + + setPhoneVerified(false) + setEmailVerified(false) + setPhoneOtpSent(false) + setEmailOtpSent(false) + setEnteredPhoneOtp('') + setEnteredEmailOtp('') + + setGstin('29AAAAA1111A1Z1') + setIsGstinVerified(false) + setAadharFile(null) + setPanFile(null) + + setStoreName('My Artisan Handloom') + setStoreLogo(null) + setBusinessBio('Traditional weaving and local sustainable designs.') + setAddress({ + street: '123 Handloom Lane', + city: 'Textile Town', + state: 'Karnataka', + pincode: '560001' + }) + setMapCoordinates({ lat: 12.9716, lng: 77.5946 }) + + navigateTo('home', true) + }) + } + + const handleRegisterSubmit = (e: React.FormEvent) => { e.preventDefault() @@ -548,7 +592,7 @@ export default function App() {
{currentPage === 'dashboard' ? ( - ) : (