enabled registration
This commit is contained in:
@@ -2,6 +2,7 @@ import { createRouter, createWebHistory } from 'vue-router'
|
||||
import { initAuth, getLastRoom, setLastRoom } from './store'
|
||||
|
||||
import LoginPage from './pages/LoginPage.vue'
|
||||
import RegisterPage from './pages/RegisterPage.vue'
|
||||
import ChatPage from './pages/ChatPage.vue'
|
||||
import FriendListPage from './pages/FriendListPage.vue'
|
||||
import NofificationsPage from './pages/NotificationsPage.vue'
|
||||
@@ -16,6 +17,12 @@ const router = createRouter({
|
||||
component: LoginPage,
|
||||
meta: { hideNavbar: true }
|
||||
},
|
||||
{
|
||||
path: '/register',
|
||||
name: 'register',
|
||||
component: RegisterPage,
|
||||
meta: { hideNavbar: true }
|
||||
},
|
||||
{
|
||||
path: '/rooms/:uuid',
|
||||
name: 'chat',
|
||||
@@ -28,7 +35,7 @@ const router = createRouter({
|
||||
})
|
||||
|
||||
router.beforeEach(async (to) => {
|
||||
if (to.path === '/login') return true
|
||||
if (to.path === '/login' || to.path === '/register') return true
|
||||
|
||||
const auth = await initAuth()
|
||||
if (!auth.isAuthenticated) {
|
||||
|
||||
Reference in New Issue
Block a user