1
0
Fork 0
mirror of https://github.com/Luzifer/browserphone.git synced 2024-11-08 13:50:05 +00:00

Add auth to capability token URL

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2022-12-10 20:03:58 +01:00
parent d7a753d70a
commit 8561eed3f8
Signed by: luzifer
GPG key ID: D91C3E91E4CAD6F5
3 changed files with 8 additions and 2 deletions

1
dist/index.html vendored
View file

@ -16,6 +16,7 @@
<body>
<div id="app"></div>
<script>
window.capabilityTokenAuth = '{{ env `CAP_TOKEN_AUTH` }}'
window.capabilityTokenURL = '{{ env `CAP_TOKEN_URL` }}'
</script>
<script src="app.js"></script>

View file

@ -138,7 +138,11 @@ export default {
this.phone.device.destroy()
}
axios.get(config.capabilityTokenURL)
axios.get(config.capabilityTokenURL, {
headers: {
authorization: `Bearer ${config.capabilityTokenAuth}`,
},
})
.then(resp => {
this.phone.device = new Device(resp.data.token, opts)

View file

@ -1,3 +1,4 @@
export default {
capabilityTokenAuth: window.capabilityTokenAuth,
capabilityTokenURL: window.capabilityTokenURL,
}