Skip to content

Commit

Permalink
oauth2: Delete Token Banner
Browse files Browse the repository at this point in the history
This updates the Delete Token functionality to show a success/error
banner when deleting the token. If successful it will delete the Token
tab and content, load the IdP tab, and show a success banner with the
JSON content. On error it will simply show an error banner with the JSON
content.
  • Loading branch information
JediKev committed Feb 22, 2023
1 parent f531718 commit c0cd8b1
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions include/staff/templates/email-oauth2auth.tmpl.php
Expand Up @@ -189,8 +189,17 @@
url: 'ajax.php/' + $(this).attr('href').substr(1),
type: 'POST',
success: function(json) {
$.toggleOverlay(false);
$('#popup').hide();
// Remove the Token tab completely
$('#popup a[href="#token"]').parent().remove();
$('#popup div#token').remove();
// Add success banner
$('#popup form').before('<div id="msg_notice">'+json+'</div>');
// Load the IdP tab
$('#popup a[href="#idp"]').click();
},
error: function(json) {
// Add error banner
$('#popup form').before('<div id="msg_error">'+json.responseText+'</div>');
}
});
}
Expand Down

0 comments on commit c0cd8b1

Please sign in to comment.