coba deprecated
This commit is contained in:
parent
5c4bbf3414
commit
537dfcfb34
@ -1,5 +1,4 @@
|
|||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
import { isServer } from '#imports'
|
|
||||||
|
|
||||||
export const useAuthStore = defineStore('auth', () => {
|
export const useAuthStore = defineStore('auth', () => {
|
||||||
const accessToken = useCookie('access_token', {
|
const accessToken = useCookie('access_token', {
|
||||||
@ -43,8 +42,7 @@ export const useAuthStore = defineStore('auth', () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const fetchUser = async () => {
|
const fetchUser = async () => {
|
||||||
if (isServer) return;
|
if (process.server || !accessToken.value) return;
|
||||||
if (!accessToken.value) return
|
|
||||||
try {
|
try {
|
||||||
const data = await $fetch(`${config.public.apiBase}/auth/users/me/`, {
|
const data = await $fetch(`${config.public.apiBase}/auth/users/me/`, {
|
||||||
headers: {
|
headers: {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user