0

here are my routes :

<BrowserRouter>
  <Routes>
    <Route exact path="/" element={<Dashboard />} />
    <Route exact path="/login" element={<Login />} />
  </Routes>
</BrowserRouter>

and when user does not have a token axios interceptor will redirect the user to login page

{
    localStorage.clear();
    window.location.href = "/login";
    return Promise.reject(error);
  }

this works fine in development mode, but as i build the app the redirection fails and show error : The requested path cannnot be found, the path is not present if i manually type /login after url.

enter image description here

0 Answers0