0👍
I also had the same problem and here is my workaround.
On the middleware file, return redirect to the desired page then add an optional query parameter that you would check against on the desired page when it loads. then on conditional check against that query parameter, you pop up a notification. You can use noty plugin to display the notification.
So in summary…
//In middleware file
return('/to/desired/page?queryName=queryValue')
//In Desired Page file
<script>
...
mounted(){
if(this.$route.query.queryName == queryValue){
this.$noty.error('your notification message here')
// or .info or .warning ...check the link for more
}
}
...
</script>
- [Vuejs]-VueJS/Vuetify – @change set loading="true" on input
- [Vuejs]-Nuxt Auth middleware making empty request to the user endpoint
Source:stackexchange.com