title: How to ignore Login for another Route using react-router-dom v5
body: <p>Here I have a already built vuexy template where it has a setup like if user gets logout it routed to the /login , but I'm setting up Forgot Password / Functionality where user will only have email to make post request and in this case I want to route to another route like /password-reset-request , Now this setup is preventing me to achieve it, anybody knows how to do that .</p>
  <p>They setup is like that using <code>&quot;react-router-dom&quot;: &quot;^5.2.0&quot;,</code>
  this link is in login page</p>
  <pre><code>&lt;Link className='brand-logo mb-0' to='/password-reset-request' onClick={e =&gt; e.preventDefault()}&gt;
          &lt;span className='brand-logo mb-0'&gt;
            Forgot Password ?
          &lt;/span&gt; 
          &lt;/Link&gt;
  </code></pre>
  <p>EDIT :</p>
  <pre><code>export const authSlice = createSlice({
    name: 'authentication',
    initialState: {
      userData: initialUser()
    },
    reducers: {
      handleLogin: (state, action) =&gt; {
        state.userData = action.payload
        state[config.storageTokenKeyName] = action.payload[config.storageTokenKeyName]
        state[config.storageRefreshTokenKeyName] = action.payload[config.storageRefreshTokenKeyName]
        localStorage.setItem('userData', JSON.stringify(action.payload))
        localStorage.setItem(config.storageTokenKeyName, JSON.stringify(action.payload.accessToken))
        localStorage.setItem(config.storageRefreshTokenKeyName, JSON.stringify(action.payload.refreshToken))
      },
      handleLogout: state =&gt; {
        state.userData = {}
        state[config.storageTokenKeyName] = null
        state[config.storageRefreshTokenKeyName] = null
        // ** Remove user, accessToken &amp; refreshToken from localStorage
        localStorage.removeItem('userData')
        localStorage.removeItem(config.storageTokenKeyName)
        localStorage.removeItem(config.storageRefreshTokenKeyName)
      }
    }
  })
  
  export const { handleLogin, handleLogout } = authSlice.actions
  
  export default authSlice.reducer
  </code></pre>
  <p>If handleLogout called then it redirects to /login</p>
  <pre><code>{
      path: '/login',
      component: lazy(() =&gt; import('../../views/Login')),
      layout: 'BlankLayout', //
      meta: {
        authRoute: true
      }
    },
  {
      path: '/password-reset-request',
      component: lazy(() =&gt; import('../../views/AuthComponents/ForgotPassword'))
    },
  </code></pre>
  <p>My main point is if userData is not in local storage then user can also go to /loing and /password-reset-request if he wants to.</p>