UI to access / refresh access token

environments/review-docs-devel-1399dq/deployments/6607
Agate 2020-08-19 19:51:11 +02:00
rodzic 30f6a77e68
commit 607e492952
1 zmienionych plików z 14 dodań i 0 usunięć

Wyświetl plik

@ -26,6 +26,14 @@
<label for="copy-secret"><translate translate-context="Content/Applications/Label">Application secret</translate></label>
<copy-input id="copy-secret" :value="application.client_secret" />
</div>
<div class="field" v-if="application.token != undefined">
<label for="copy-secret"><translate translate-context="Content/Applications/Label">Access token</translate></label>
<copy-input id="copy-secret" :value="application.token" />
<a href="" @click.prevent="refreshToken">
<i class="refresh icon"></i>
<translate translate-context="Content/Applications/Label">Regenerate token</translate>
</a>
</div>
</div>
<h2 class="ui header">
<translate translate-context="Content/Applications/Title">Edit application</translate>
@ -68,6 +76,12 @@ export default {
self.errors = error.backendErrors
})
},
async refreshToken () {
self.isLoading = true
let response = await axios.post(`oauth/apps/${this.id}/refresh-token`)
this.application = response.data
self.isLoading = false
}
},
computed: {
labels() {