Remove native confirm() calls in revokeToken/rotateToken
Native confirm() blocks browser automation entirely (found live, mid
browser-test of the app.messages/app.modal adoption, on sso-manager-node's
equivalent flow). Both functions already receive btn, whose .closest('.card')
is already used for the error path, so app.messages.confirm targets the
same card.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -178,16 +178,18 @@
|
||||
});
|
||||
}
|
||||
|
||||
function revokeToken(id, name, btn){
|
||||
if(!confirm('Revoke API token "' + name + '"? It stops working immediately.')) return;
|
||||
async function revokeToken(id, name, btn){
|
||||
const ok = await app.messages.confirm('Revoke API token "' + name + '"? It stops working immediately.', $(btn).closest('.card'), 'danger');
|
||||
if(!ok) return;
|
||||
app.apiToken.remove({id: id}, function(error, data){
|
||||
if(error) return app.messages.action(error, $(btn).closest('.card'), 'danger');
|
||||
$.scope.apiTokenCard.remove('id', id);
|
||||
});
|
||||
}
|
||||
|
||||
function rotateToken(id, name, btn){
|
||||
if(!confirm('Rotate API token "' + name + '"? The old token stops working immediately.')) return;
|
||||
async function rotateToken(id, name, btn){
|
||||
const ok = await app.messages.confirm('Rotate API token "' + name + '"? The old token stops working immediately.', $(btn).closest('.card'), 'warning');
|
||||
if(!ok) return;
|
||||
app.apiToken.rotate({id: id}, function(error, data){
|
||||
if(error) return app.messages.action(error, $(btn).closest('.card'), 'danger');
|
||||
showSecret(data.token);
|
||||
|
||||
Reference in New Issue
Block a user