Fix Janrain due to change in behavior
Janrain has started providing the login token via a POST request in addition to including it in the query string. This results in request.vars.token being a list containing two copies of the token, which breaks the web2py code. This change keeps just a single copy of the token.
This commit is contained in:
1 parent
c9fd0fd71e
commit
071622b9d9
2 files changed
+10
-4
No files matched your search
@@ -78,10 +78,13 @@ class RPXAccount(object):
|
|||||||
|
|
||||||
def get_user(self):
|
def get_user(self):
|
||||||
request = self.request
|
request = self.request
|
||||||
if request.vars.token:
|
# Janrain now sends the token via both a POST body and the query
|
||||||
|
# string, so we should keep only one of these.
|
||||||
|
token = request.post_vars.token or request.get_vars.token
|
||||||
|
if token:
|
||||||
user = Storage()
|
user = Storage()
|
||||||
data = urllib.urlencode(
|
data = urllib.urlencode(
|
||||||
dict(apiKey=self.api_key, token=request.vars.token))
|
dict(apiKey=self.api_key, token=token))
|
||||||
auth_info_json = fetch(self.auth_url + '?' + data)
|
auth_info_json = fetch(self.auth_url + '?' + data)
|
||||||
auth_info = json.loads(auth_info_json)
|
auth_info = json.loads(auth_info_json)
|
||||||
|
|
||||||
|
|||||||
@@ -78,10 +78,13 @@ class RPXAccount(object):
|
|||||||
|
|
||||||
def get_user(self):
|
def get_user(self):
|
||||||
request = self.request
|
request = self.request
|
||||||
if request.vars.token:
|
# Janrain now sends the token via both a POST body and the query
|
||||||
|
# string, so we should keep only one of these.
|
||||||
|
token = request.post_vars.token or request.get_vars.token
|
||||||
|
if token:
|
||||||
user = Storage()
|
user = Storage()
|
||||||
data = urllib.urlencode(
|
data = urllib.urlencode(
|
||||||
dict(apiKey=self.api_key, token=request.vars.token))
|
dict(apiKey=self.api_key, token=token))
|
||||||
auth_info_json = fetch(self.auth_url + '?' + data)
|
auth_info_json = fetch(self.auth_url + '?' + data)
|
||||||
auth_info = json.loads(auth_info_json)
|
auth_info = json.loads(auth_info_json)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user