export async function UserCheck(){

  let token = localStorage.getItem('BPChat')
    const response = await fetch('https://docs.black-phoenix.ru/api/users/me', {
      method: 'GET',
      credentials:'include',
      headers: {'Authorization': token },

    })
  
    if(!response.ok){
      console.log(response)
      return(response.status)
    }

    else{
       const data = await response.json();
       return data
    }
  }

export async function handleLogout() {

  localStorage.removeItem('BPChat')
  location.assign('/login')

}
  
  