Nuxt.js: how to redirect in server side ?

Created on 8 Mar 2018  路  2Comments  路  Source: nuxt/nuxt.js

for example, I dispatch action in fetch method and send ajax in action. what should I do if I want to redirect to 'login' according to the ajax response?

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

Most helpful comment

In the context you have redirect method:
https://nuxtjs.org/api/context

You can use middleware too:
https://nuxtjs.org/api/pages-middleware

All 2 comments

In the context you have redirect method:
https://nuxtjs.org/api/context

You can use middleware too:
https://nuxtjs.org/api/pages-middleware

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