added registration token rotation function to UI
parent
78ebcd030d
commit
f12d37f84e
|
@ -274,6 +274,23 @@ var ClientView = Backbone.View.extend({
|
|||
|
||||
$('#modalAlert .modal-body').html(_self.registrationTokenTemplate(savedModel));
|
||||
|
||||
$('#modalAlert .modal-body #rotate-token').click(function(e) {
|
||||
token.save(null, {success: function() {
|
||||
console.log('token:' + token.get('value'));
|
||||
$('#modalAlert .modal-body #registrationToken').val(token.get('value'));
|
||||
},
|
||||
error: function() {
|
||||
$('#modalAlert .modal-body').html('There was a problem rotating the registration access token for this client.');
|
||||
|
||||
$('#modalAlert').modal({
|
||||
'backdrop': 'static',
|
||||
'keyboard': true,
|
||||
'show': true
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#modalAlert').modal({
|
||||
'backdrop': 'static',
|
||||
'keyboard': true,
|
||||
|
|
|
@ -759,4 +759,8 @@
|
|||
<input type="text" id="registrationToken" readonly style="cursor: text" class="token-full input-xxlarge" value="<%- registrationToken %>" />
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button class="btn btn-warning" id="rotate-token"><i class="icon-retweet icon-white"></i> Rotate registration token</button>
|
||||
</div>
|
||||
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue