diff --git a/auth/models.py b/auth/models.py index 150f51c..9b7882b 100644 --- a/auth/models.py +++ b/auth/models.py @@ -99,3 +99,14 @@ def create_bearer_token(cls, user_id): A token object, or None if one could not be created. """ return cls.token_model.create(user_id, 'bearer') + + @classmethod + def delete_bearer_token(cls, user_id, token): + """Deletes a given bearer authorization token. + + :param user_id: + User unique ID. + :param token: + A string with the authorization token. + """ + cls.token_model.get_key(user_id, 'bearer', token).delete()