Last active
September 3, 2022 01:22
-
-
Save joshmenden/d678632334a4fca94de3f1773a9856cd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function getHeaders() { | |
const headers = {} | |
const jwt = // whatever logic you need to fetch your JWT, possible from pinia etc | |
if (jwt) { | |
headers['Authorization'] = `Bearer ${jwt}` | |
} | |
headers['Content-Type'] = 'application/json' | |
return headers | |
} | |
const defaultOptions = { | |
query: { | |
errorPolicy: 'all', | |
}, | |
mutate: { | |
errorPolicy: 'all', | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment