1👍
You can create a method instead to check the authenticated user and ran the method in the created() or mounted() block. Or you can use vuex which is a much better option
- [Vuejs]-Vue-socket.io Uncaught TypeError: Cannot read property of undefined
- [Vuejs]-Scope of "this" in Vue TypeScript project
Source:stackexchange.com