Allow user to change their API key.

(imported from commit b7c50779d0209c6e6600b59c8760a81273fe2454)
This commit is contained in:
Steve Howell
2013-08-08 12:08:30 -04:00
parent 164215bc78
commit 722c1b1a43
2 changed files with 19 additions and 4 deletions

View File

@@ -220,7 +220,18 @@ $(function () {
});
$("#show_api_key_box").on("click", "button.regenerate_api_key", function (e) {
$.ajax({
url: '/json/users/me/api_key/regenerate',
type: 'POST',
success: function (data) {
$('#api_key_value').text(data.api_key);
},
error: function (xhr) {
$('#user_api_key_error').text(JSON.parse(xhr.responseText).msg).show();
}
});
});
});