mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-28 00:07:57 -05:00
Switch user ids to id36s for consistency and str type keys.
This commit is contained in:
@@ -128,7 +128,7 @@ class OAuth2FrontendController(RedditController):
|
||||
self._check_redirect_uri(client, redirect_uri)
|
||||
|
||||
if not c.errors:
|
||||
code = OAuth2AuthorizationCode._new(client._id, redirect_uri, c.user._id, scope)
|
||||
code = OAuth2AuthorizationCode._new(client._id, redirect_uri, c.user._id36, scope)
|
||||
resp = {"code": code._id, "state": state}
|
||||
return self.redirect(redirect_uri+"?"+urlencode(resp), code=302)
|
||||
else:
|
||||
@@ -213,7 +213,7 @@ class OAuth2ResourceController(MinimalController):
|
||||
access_token = OAuth2AccessToken.get_token(self._get_bearer_token())
|
||||
require(access_token)
|
||||
c.oauth2_access_token = access_token
|
||||
account = Account._byID(access_token.user_id, data=True)
|
||||
account = Account._byID36(access_token.user_id, data=True)
|
||||
require(account)
|
||||
require(not account._deleted)
|
||||
c.oauth_user = account
|
||||
|
||||
@@ -241,6 +241,7 @@ class OAuth2AuthorizationCode(ConsumableToken):
|
||||
]
|
||||
)
|
||||
_int_props = ("user_id",)
|
||||
_warn_on_partial_ttl = False
|
||||
_use_db = True
|
||||
_connection_pool = "main"
|
||||
|
||||
@@ -271,7 +272,6 @@ class OAuth2AccessToken(Token):
|
||||
_defaults = dict(scope="",
|
||||
token_type="bearer",
|
||||
)
|
||||
_int_props = ("user_id",)
|
||||
_use_db = True
|
||||
_connection_pool = "main"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user