Django & React native, I can't login back after I logged out

 const handleLogin = () => {
    axios.post('https://8d16-103-62-155-152.ngrok-free.app/api/auth/mobile-login/', { username, password })
      .then(response => {
        // Clear existing user data
        AsyncStorage.removeItem('username'); // Assuming you stored the username in AsyncStorage
  
        // Set new username and navigate to Main screen
        setUsername(username);
        navigation.navigate('Main');
      })
      .catch(error => {
        Alert.alert('Login Failed', 'Invalid username or password');
      });
  };  

THIS IS MY ERROR :

Forbidden: /api/auth/mobile-login/ [29/May/2024 13:38:49] "POST /api/auth/mobile-login/ HTTP/1.1" 403 58

I can log in once but after I click logout I can't login again I think something is preventing it to access on my django after logging out. I just used navagation for my logout function

Back to Top