Nuxt.js: Redirect after Store Action

Created on 13 Feb 2017  路  3Comments  路  Source: nuxt/nuxt.js

I am having a hard time trying to redirect in method after a store action i.e. redirect to profile upon login, redirect to '/' upon logout.

I have tried the this.$router.go after awaiting the store dispatch, but no matter the route, it just renders the page.

Is there something I am doing wrong, or is this an enhancement that could be implemented?

P.S. I should say this is a framework, combined with express is actually making me happy to develop web applications again and I look forward to production ready release.

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

Most helpful comment

Hi @mattdharmon, I'm using this.$nuxt.$router.replace({ path: '/profile }) and it works fine.
You also can use another of the vue router 2 instance methods:
https://router.vuejs.org/en/essentials/navigation.html

All 3 comments

Hi @mattdharmon, I'm using this.$nuxt.$router.replace({ path: '/profile }) and it works fine.
You also can use another of the vue router 2 instance methods:
https://router.vuejs.org/en/essentials/navigation.html

Already answered here

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nassimbenkirane picture nassimbenkirane  路  3Comments

lazycrazy picture lazycrazy  路  3Comments

ghost picture ghost  路  3Comments

vadimsg picture vadimsg  路  3Comments

bimohxh picture bimohxh  路  3Comments