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

Commit

Permalink
OAuth: Hook on token creation
Browse files Browse the repository at this point in the history
  • Loading branch information
kemitche authored and bsimpson63 committed May 12, 2016
1 parent 4a8d1b2 commit d6a36b9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions r2/r2/controllers/oauth2.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
from pylons.i18n import _

from r2.config.extensions import set_extension
from r2.lib import hooks
from r2.lib.base import abort
from reddit_base import RedditController, MinimalController, require_https
from r2.lib.db import tdb_cassandra
Expand Down Expand Up @@ -375,6 +376,10 @@ def _make_token_dict(cls, access_token, refresh_token=None):
}
if refresh_token:
resp["refresh_token"] = refresh_token._id

hooks.get_hook("oauth2.create_token").call(token_dict=resp,
token=access_token)

return resp

@validate(code=nop("code"),
Expand Down

0 comments on commit d6a36b9

Please sign in to comment.