mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-02-10 22:54:55 -05:00
Fix: add client_id to OAuth2 access tokens.
This commit is contained in:
@@ -186,7 +186,7 @@ class OAuth2AccessController(MinimalController):
|
||||
if not c.errors:
|
||||
auth_token = OAuth2AuthorizationCode.use_token(code, c.oauth2_client._id, redirect_uri)
|
||||
if auth_token:
|
||||
access_token = OAuth2AccessToken._new(auth_token.user_id, auth_token.scope)
|
||||
access_token = OAuth2AccessToken._new(auth_token.client_id, auth_token.user_id, auth_token.scope)
|
||||
resp["access_token"] = access_token._id
|
||||
resp["token_type"] = access_token.token_type
|
||||
resp["expires_in"] = access_token._ttl
|
||||
|
||||
@@ -276,9 +276,10 @@ class OAuth2AccessToken(Token):
|
||||
_connection_pool = "main"
|
||||
|
||||
@classmethod
|
||||
def _new(cls, user_id, scope_list):
|
||||
def _new(cls, client_id, user_id, scope_list):
|
||||
scope = ','.join(scope_list)
|
||||
return super(OAuth2AccessToken, cls)._new(
|
||||
client_id=client_id,
|
||||
user_id=user_id,
|
||||
scope=scope)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user