Merge pull request #90 from STRML/removeToken

Allow submitting token input with empty value to remove token.
This commit is contained in:
Raymond Feng 2015-03-05 21:45:46 -08:00
commit 641e416dc5
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) {