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:
parent
d7a753d70a
commit
8561eed3f8
3 changed files with 8 additions and 2 deletions
3
dist/index.html
vendored
3
dist/index.html
vendored
|
@ -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>
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
export default {
|
||||
capabilityTokenAuth: window.capabilityTokenAuth,
|
||||
capabilityTokenURL: window.capabilityTokenURL,
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue