Home

Issue: 2350

Call Middleware When Full URL is Entered in browser address

[issue link]

I have a middleware function that checks for logged in users and redirects them to account page if logged in.

it works well as the user is redirected to the account page after log in using $router.push(’/account’).

The Problem:

  • When the user is logged in, i typed the full address ‘http://www.url.com/accounts’ for example and press the “Enter” key, it does not trigger the middleware and it lands on the sign-in page instead.

  • When i refresh the page, it redirects me from account to sign in page as well

Any tips on how do i call the middleware when i enter the full address in the browser?

This question is available on Nuxt.js community (#c2048)