Cleanup storage code
This allows us to use either session or local storage, for issue #120.
This commit is contained in:
parent
af04dd39f7
commit
0ac3cefb03
9 changed files with 144 additions and 89 deletions
|
|
@ -84,7 +84,7 @@ const router = new VueRouter({
|
|||
router.beforeEach((to, from, next) => {
|
||||
const publicPages = ['/login'];
|
||||
var authRequired = !publicPages.includes(to.path);
|
||||
const loggedIn = localStorage.getItem('user');
|
||||
const loggedIn = router.app.$store.state.auth.user;
|
||||
|
||||
if (to.name == 'Chat' || to.name == 'Join') {
|
||||
if (!to.params.roomId && to.hash) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue