Allow expired app specific tokens to be deleted

This commit is contained in:
Joseph Schorr 2018-01-23 11:40:51 -05:00
parent b29e8202e5
commit 208dc38d25
3 changed files with 25 additions and 3 deletions

View file

@ -122,12 +122,10 @@ class AppToken(ApiResource):
@nickname('revokeAppToken')
def delete(self, token_uuid):
""" Revokes a specific app token for the user. """
token = model.appspecifictoken.get_token_by_uuid(token_uuid, owner=get_authenticated_user())
token = model.appspecifictoken.revoke_token_by_uuid(token_uuid, owner=get_authenticated_user())
if token is None:
raise NotFound()
model.appspecifictoken.revoke_token(token)
log_action('revoke_app_specific_token', get_authenticated_user().username,
{'app_specific_token_title': token.title,
'app_specific_token': token.uuid})