|
|
@@ -1,5 +1,5 @@ |
|
|
|
import RegisterArea from './register-area/register-area.vue' |
|
|
|
import Sidebar from './sidebar/sidebar.vue' |
|
|
|
import Panel from './panel/panel.vue' |
|
|
|
import '../scss/main.scss' |
|
|
|
import { createApp } from 'vue' |
|
|
|
importAll(require.context('../images', false, /\.(png|jpe?g|svg)$/)) |
|
|
@@ -20,7 +20,7 @@ function getCookie(name) { |
|
|
|
return (value != null) ? unescape(value[1]) : null |
|
|
|
} |
|
|
|
|
|
|
|
function getToken() { |
|
|
|
function getToken(app) { |
|
|
|
fetch("/sanctum/csrf-cookie", { |
|
|
|
method: 'GET' |
|
|
|
}).then( () => { |
|
|
@@ -76,15 +76,13 @@ function toggleNav() { |
|
|
|
this.classList.toggle("toggled") |
|
|
|
} |
|
|
|
|
|
|
|
if (!token) {getToken()} |
|
|
|
|
|
|
|
if (window.location.pathname == '/') { |
|
|
|
document.getElementById('nav_toggle').addEventListener('click', toggleNav) |
|
|
|
document.querySelector('#login_form button').addEventListener('click', login) |
|
|
|
const app = createApp(RegisterArea).mount('#app') |
|
|
|
app.token = token |
|
|
|
// console.log(app.token) |
|
|
|
// console.log(app.$data.active) |
|
|
|
// app.token = token |
|
|
|
if (!token) {getToken(app)} |
|
|
|
|
|
|
|
//Triggers for registration menu |
|
|
|
for (let i = 0; i < registerToggles.length; i++) { |
|
|
@@ -110,7 +108,7 @@ if (window.location.pathname == '/') { |
|
|
|
} else if (window.location.pathname == '/verify-email') { |
|
|
|
document.getElementById('resend_verification').addEventListener("click", resendLink) |
|
|
|
} else if (window.location.pathname == '/panel') { |
|
|
|
const app = createApp(Sidebar).mount('#panel') |
|
|
|
app.token = token |
|
|
|
const app = createApp(Panel).mount('#panel') |
|
|
|
if (!token) {getToken(app)} |
|
|
|
} |
|
|
|
|