From 202c2a75187786583a20e55c99c83c389336158b Mon Sep 17 00:00:00 2001 From: Mez Date: Thu, 19 Jun 2014 15:28:12 -0400 Subject: [PATCH] Update models.py This will give people an option to 'logout' --- auth/models.py | 11 +++++++++++ 1 file changed, 11 insertions(+) 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()