mirror of
https://github.com/emailerfacu-spec/minix-front.git
synced 2026-04-01 13:10:44 -03:00
arreglado acceso a la store
This commit is contained in:
@@ -1,14 +1,15 @@
|
||||
import { goto } from '$app/navigation';
|
||||
import { apiBase } from '@/stores/url';
|
||||
import { sesionStore } from '@/stores/usuario';
|
||||
import { get } from 'svelte/store';
|
||||
|
||||
export async function logout(menuOpen: boolean) {
|
||||
try {
|
||||
const req = await fetch($apiBase + '/api/auth/logout', {
|
||||
const req = await fetch(get(apiBase) + '/api/auth/logout', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: `Bearer ${$sesionStore.accessToken}`
|
||||
Authorization: `Bearer ${get(sesionStore)?.accessToken}`
|
||||
},
|
||||
credentials: 'include'
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user