initial commit

This commit is contained in:
SowinskiBraeden committed 2023-01-11 10:29:07 -08:00
1 parent bcc525d802
commit e3a01ef9d1
12 files changed
+315 -66

No files matched your search

+54
View File
@@ -0,0 +1,54 @@
<template>
<div>
<nav>
<router-link to="/">Home</router-link> |
<router-link to="/" @click="logout()">Logout</router-link>
</nav>
</div>
</template>
<script>
export default {
name: 'DashboardNav',
data() {
return {
API_URL: process.env.VUE_APP_API_URL,
}
},
methods: {
logout() {
const res = fetch(`${this.API_URL}/logout`, {
method: 'POST',
credentials: 'include',
headers: {
'Content-Type': 'application/json',
},
}).then(response =>
response.json().then(data => ({
data: data,
status: response.status,
})).then(res => res)
);
// if (res.status != 200) // do something
if (res.data.success) this.$router.push('/');
}
}
}
</script>
<style>
nav {
padding: 30px;
}
nav a {
font-weight: bold;
color: #2c3e50;
}
nav a.router-link-exact-active {
color: #42b983;
}
</style>