Allow submitting token input with empty value to remove token.

This commit is contained in:
Samuel Reed 2015-03-06 12:32:45 +07:00
parent 036591bcba
commit b7c14b7a09
1 changed files with 11 additions and 0 deletions

View File

@ -64,6 +64,17 @@ $(function() {
window.localStorage.setItem(lsKey, key);
}
}
// If submitted with an empty token, remove the current token. Can be
// useful to intentionally remove authorization.
else {
log('removed accessToken.');
$('.accessTokenDisplay').text('Token Not Set.').removeClass('set');
$('.accessTokenDisplay').removeAttr('data-tooltip');
window.authorizations.remove('key');
if (window.localStorage) {
window.localStorage.removeItem(lsKey);
}
}
}
function onInputChange(e) {