import axios from 'axios' ; import callWithAuth from './callWithAuth' ; axios . defaults . baseURL = process . env . NEXT_PUBLIC_API_PATH || 'http://localhost/' ; const UserAPI = { getCurrent : async ( tokens ? ) => { try { const { data } = await callWithAuth ( 'GET' , '/user/current' , { } , tokens ) ; return data . user ; } catch ( error ) { console . error ( '[UserAPI.get] Error: ' , error ) ; return null ; } } , } ; export default UserAPI ;