Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
139
Merge Requests
139
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
d885e20e
Commit
d885e20e
authored
Feb 15, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oauth_facebook_login: python3 compatibility
parent
c3488a67
Pipeline
#35174
failed with stage
in 0 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
bt5/erp5_oauth_facebook_login/SkinTemplateItem/portal_skins/erp5_oauth_facebook_login/ERP5Site_callbackFacebookLogin.py
...p5_oauth_facebook_login/ERP5Site_callbackFacebookLogin.py
+2
-2
product/ERP5Security/ERP5ExternalOauth2ExtractionPlugin.py
product/ERP5Security/ERP5ExternalOauth2ExtractionPlugin.py
+5
-2
No files found.
bt5/erp5_oauth_facebook_login/SkinTemplateItem/portal_skins/erp5_oauth_facebook_login/ERP5Site_callbackFacebookLogin.py
View file @
d885e20e
...
@@ -21,8 +21,8 @@ elif code is not None:
...
@@ -21,8 +21,8 @@ elif code is not None:
code
,
code
,
"{0}/ERP5Site_callbackFacebookLogin"
.
format
(
context
.
absolute_url
()))
"{0}/ERP5Site_callbackFacebookLogin"
.
format
(
context
.
absolute_url
()))
if
response_dict
is
not
None
:
if
response_dict
is
not
None
:
access_token
=
response_dict
[
'access_token'
]
.
encode
(
'utf-8'
)
access_token
=
response_dict
[
'access_token'
]
hash_str
=
context
.
Base_getHMAC
(
access_token
,
access_token
)
hash_str
=
context
.
Base_getHMAC
(
access_token
.
encode
(
'utf-8'
),
access_token
.
encode
(
'utf-8'
)
)
context
.
setAuthCookie
(
response
,
'__ac_facebook_hash'
,
hash_str
)
context
.
setAuthCookie
(
response
,
'__ac_facebook_hash'
,
hash_str
)
# store timestamp in second since the epoch in UTC is enough
# store timestamp in second since the epoch in UTC is enough
...
...
product/ERP5Security/ERP5ExternalOauth2ExtractionPlugin.py
View file @
d885e20e
...
@@ -218,11 +218,14 @@ def getFacebookUserEntry(token):
...
@@ -218,11 +218,14 @@ def getFacebookUserEntry(token):
if
facebook_entry
is
not
None
:
if
facebook_entry
is
not
None
:
# sanitise value
# sanitise value
for
k
in
(
'name'
,
'id'
):
for
k
in
(
'name'
,
'id'
):
v
=
facebook_entry
[
k
]
if
six
.
PY2
:
v
=
v
.
encode
(
'utf-8'
)
try
:
try
:
if
k
==
'id'
:
if
k
==
'id'
:
user_entry
[
'reference'
]
=
facebook_entry
[
k
].
encode
(
'utf-8'
)
user_entry
[
'reference'
]
=
v
else
:
else
:
user_entry
[
k
]
=
facebook_entry
[
k
].
encode
(
'utf-8'
)
user_entry
[
k
]
=
v
except
KeyError
:
except
KeyError
:
raise
ValueError
(
facebook_entry
)
raise
ValueError
(
facebook_entry
)
return
user_entry
return
user_entry
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment