Login.js:106 
        
        
        POST http://192.168.7.206:3006/api/auth/login net::ERR_CONNECTION_TIMED_OUT
handleLogin @ Login.js:106
callCallback @ react-dom.development.js:4163
invokeGuardedCallbackDev @ react-dom.development.js:4212
invokeGuardedCallback @ react-dom.development.js:4276
invokeGuardedCallbackAndCatchFirstError @ react-dom.development.js:4290
executeDispatch @ react-dom.development.js:9040
processDispatchQueueItemsInOrder @ react-dom.development.js:9071
processDispatchQueue @ react-dom.development.js:9085
dispatchEventsForPlugins @ react-dom.development.js:9096
(anonymous) @ react-dom.development.js:9287
batchedUpdates$1 @ react-dom.development.js:26178
batchedUpdates @ react-dom.development.js:3990
dispatchEventForPluginEventSystem @ react-dom.development.js:9285
dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay @ react-dom.development.js:6464
dispatchEvent @ react-dom.development.js:6456
dispatchDiscreteEvent @ react-dom.development.js:6429
Login.js:106 
        
        
        POST http://192.168.7.206:3006/api/auth/login net::ERR_CONNECTION_TIMED_OUT
handleLogin @ Login.js:106
callCallback @ react-dom.development.js:4163
invokeGuardedCallbackDev @ react-dom.development.js:4212
invokeGuardedCallback @ react-dom.development.js:4276
invokeGuardedCallbackAndCatchFirstError @ react-dom.development.js:4290
executeDispatch @ react-dom.development.js:9040
processDispatchQueueItemsInOrder @ react-dom.development.js:9071
processDispatchQueue @ react-dom.development.js:9085
dispatchEventsForPlugins @ react-dom.development.js:9096
(anonymous) @ react-dom.development.js:9287
batchedUpdates$1 @ react-dom.development.js:26178
batchedUpdates @ react-dom.development.js:3990
dispatchEventForPluginEventSystem @ react-dom.development.js:9285
dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay @ react-dom.development.js:6464
dispatchEvent @ react-dom.development.js:6456
dispatchDiscreteEvent @ react-dom.development.js:6429
Login.js:106 
        
        
        POST http://192.168.7.206:30        THIS ERROR ..NETWORK ERROR WHILE LOGGING  import React, { useState, useEffect } from 'react';
import { useNavigate, useLocation } from 'react-router-dom';
import './Login.css';


const Login = () => {
    const [username, setUsername] = useState('');
    const [password, setPassword] = useState('');
    const [error, setError] = useState('');
    const navigate = useNavigate();
    // Added useLocation to handle state from redirects
    const location = useLocation();
    

    // Added useEffect to handle redirect messages
    useEffect(() => {
        // Check if there's a message from redirect
        const state = location.state;
        if (state?.message) {
            setError(state.message);
        }
    }, [location]);

    const handleLogin = async (e) => {
        e.preventDefault();
        setError('');

        try {
            const response = await fetch('http://192.168.2.5:3006/api/auth/login', {
                method: 'POST',
                headers: {
                    'Content-Type': 'application/json',
                },
                body: JSON.stringify({ username, password }),
            });

            const data = await response.json();
            if (response.ok) {
                // Store token and user info in localStorage
                localStorage.setItem('token', data.token);
                localStorage.setItem('userId', data.userId);
                localStorage.setItem('username', data.username);

                // Added check for redirect after login
                const state = location.state;
                if (state?.redirectAfterLogin) {
                    // Redirect to the page that required login
                    navigate(state.redirectAfterLogin, { replace: true });
                } else {
                    // Default redirect to library
                    navigate('/library');
                }
            } else {
                setError(data.message || 'Login failed');
            }
        } catch (err) {
            setError('Network error. Please try again.');
        }
    };

    // Rest of the component remains the same
    return (
            <div className="login-container">
              <form onSubmit={handleLogin}>
                <h2>Login</h2>
                {error && <p style={{ color: 'red' }}>{error}</p>}
                <input
                  type="text"
                  placeholder="Username"
                  value={username}
                  onChange={(e) => setUsername(e.target.value)}
                  required
                />
                <input
                  type="password"
                  placeholder="Password"
                  value={password}
                  onChange={(e) => setPassword(e.target.value)}
                  required
                />
                <button type="submit">Login</button>
                <p>
                  Don't have an account? 
                  <span 
                    onClick={() => navigate('/signup')} 
                    style={{ color: 'blue', cursor: 'pointer' }}
                  >
                    Sign up
                  </span>
                </p>
              </form>
            </div>
          );
        };
        
        export default Login;   THIS IS LOGIN.JS