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

3
dist/index.html vendored
View file

@ -6,7 +6,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css"
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css"
integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay" crossorigin="anonymous">
<title>BrowserPhone</title>
@ -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,
}