added click through sanity check to registration token rotation, closes #698

pull/873/head
Justin Richer 2014-10-23 23:28:48 -04:00
parent d5c96f5d0d
commit 2fc164afca
1 changed files with 16 additions and 14 deletions

View File

@ -275,20 +275,22 @@ 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
});
}
});
if (confirm("Are you sure you want to rotate this client's registration token?")) {
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({