corrected old env names and fixed logout redirect
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
# SITE SETTINGS
|
||||
BASE_URL=
|
||||
VITE_APIHOST=
|
||||
|
||||
@@ -27,12 +27,13 @@ const userStore = useUserStore();
|
||||
const APIHOST = import.meta.env.VITE_APIHOST;
|
||||
|
||||
async function logout() {
|
||||
await fetch(`${APIHOST}/logout`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
});
|
||||
// await fetch(`${APIHOST}/logout`, {
|
||||
// method: 'GET',
|
||||
// credentials: 'include',
|
||||
// });
|
||||
|
||||
userStore.user = null;
|
||||
window.location.href = APIHOST + "/logout";
|
||||
}
|
||||
|
||||
function formatDate(dateStr) {
|
||||
|
||||
@@ -2,7 +2,7 @@ import { useUserStore } from '@/stores/user'
|
||||
import { createRouter, createWebHistory } from 'vue-router'
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(import.meta.env.BASE_URL),
|
||||
history: createWebHistory(import.meta.env.VITE_APIHOST),
|
||||
routes: [
|
||||
// PUBLIC
|
||||
{ path: '/join', component: () => import('@/pages/Join.vue') },
|
||||
|
||||
Reference in New Issue
Block a user