Skip to content
This repository has been archived by the owner on May 22, 2022. It is now read-only.

Commit

Permalink
OAuth2: Add hook on token revocation
Browse files Browse the repository at this point in the history
  • Loading branch information
kemitche committed May 7, 2015
1 parent 2e998ea commit a95d171
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions r2/r2/models/token.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
from pylons import g, c
from pylons.i18n import _

from r2.lib import hooks
from r2.lib.db import tdb_cassandra
from r2.lib.db.thing import NotFound
from r2.models.account import Account
Expand Down Expand Up @@ -663,6 +664,8 @@ def revoke(self):
else:
tba._commit()

hooks.get_hook("oauth2.revoke_token").call(token=self)

@classmethod
def revoke_all_by_user(cls, account):
"""Revokes all access tokens for a given user Account."""
Expand Down

0 comments on commit a95d171

Please sign in to comment.