Last active
November 6, 2020 17:19
-
-
Save fredriccliver/13756dc2aac75fe18639c6a4f6569a5c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
let option = {} | |
if (locale) { | |
let token = await firebase.auth().currentUser?.getIdToken() | |
option = { | |
params: { yourParam: valueOfParam }, | |
headers: { | |
Authorization: `Bearer ${token}` | |
} | |
} | |
} | |
axios | |
.get("/endpoint", option) | |
.then((result) => { | |
// do with result | |
}) | |
.catch((e) => { | |
// do with error | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment