fix login
Browse files186 unmodified lines187188189190191192193194195196197198199200201202203204205206207208209210211212213214215186 unmodified linesreturn;}// Check authentication statusif (!isAuthenticated) {alert('Please log in to deploy your app. Click the "Sign in with Hugging Face" button in the header.');return;}// Ensure username is loadedlet currentUsername = username;if (!currentUsername) {console.warn('[Deploy] Username not loaded yet, fetching...');try {const authStatus = await apiClient.getAuthStatus();if (authStatus.username) {currentUsername = authStatus.username;setUsername(authStatus.username);} else {alert('Could not get username. Please try logging out and back in.');return;}} catch (e) {console.error('[Deploy] Error getting username:', e);alert('Could not get username. Please try logging out and back in.');return;}}186 unmodified lines187188189190191192193194195196197198199200201202203204205206186 unmodified linesreturn;}// Get current username (fetch if not loaded)let currentUsername = username;if (!currentUsername) {console.log('[Deploy] Username not in state, fetching from auth...');try {const authStatus = await apiClient.getAuthStatus();if (authStatus.username) {currentUsername = authStatus.username;setUsername(authStatus.username);console.log('[Deploy] Fetched username:', currentUsername);}} catch (e) {console.error('[Deploy] Could not get username:', e);// Don't fail - let backend handle auth}}
frontend/src/app/page.tsx+5-14