Skip to content

Commit 841e4b4

Browse files
committed
added click through sanity check to registration token rotation, closes mitreid-connect#698
1 parent 9e1bd8d commit 841e4b4

File tree

1 file changed

+16
-14
lines changed
  • openid-connect-server-webapp/src/main/webapp/resources/js

1 file changed

+16
-14
lines changed

openid-connect-server-webapp/src/main/webapp/resources/js/client.js

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -275,20 +275,22 @@ var ClientView = Backbone.View.extend({
275275
$('#modalAlert .modal-body').html(_self.registrationTokenTemplate(savedModel));
276276

277277
$('#modalAlert .modal-body #rotate-token').click(function(e) {
278-
token.save(null, {success: function() {
279-
console.log('token:' + token.get('value'));
280-
$('#modalAlert .modal-body #registrationToken').val(token.get('value'));
281-
},
282-
error: function() {
283-
$('#modalAlert .modal-body').html('There was a problem rotating the registration access token for this client.');
284-
285-
$('#modalAlert').modal({
286-
'backdrop': 'static',
287-
'keyboard': true,
288-
'show': true
289-
});
290-
}
291-
});
278+
if (confirm("Are you sure you want to rotate this client's registration token?")) {
279+
token.save(null, {success: function() {
280+
console.log('token:' + token.get('value'));
281+
$('#modalAlert .modal-body #registrationToken').val(token.get('value'));
282+
},
283+
error: function() {
284+
$('#modalAlert .modal-body').html('There was a problem rotating the registration access token for this client.');
285+
286+
$('#modalAlert').modal({
287+
'backdrop': 'static',
288+
'keyboard': true,
289+
'show': true
290+
});
291+
}
292+
});
293+
}
292294
});
293295

294296
$('#modalAlert').modal({

0 commit comments

Comments
 (0)