delete unused attributes (social auth)
This commit is contained in:
parent
442e4fb2ce
commit
ba2b3303bb
|
|
@ -1,6 +1,4 @@
|
||||||
"""Common views for application Account"""
|
"""Common views for application Account"""
|
||||||
import hashlib
|
|
||||||
import hmac
|
|
||||||
import json
|
import json
|
||||||
|
|
||||||
from braces.views import CsrfExemptMixin
|
from braces.views import CsrfExemptMixin
|
||||||
|
|
@ -59,16 +57,12 @@ class OAuth2ViewMixin(CsrfExemptMixin, OAuthLibMixin, BaseOAuth2ViewMixin):
|
||||||
client_id = credentials.get('client_id')
|
client_id = credentials.get('client_id')
|
||||||
client_secret = credentials.get('client_secret')
|
client_secret = credentials.get('client_secret')
|
||||||
token = validated_data.get('token')
|
token = validated_data.get('token')
|
||||||
appsecret_proof = hmac.new(settings.SOCIAL_AUTH_FACEBOOK_KEY.encode('utf-8'),
|
|
||||||
msg=settings.SOCIAL_AUTH_FACEBOOK_SECRET.encode('utf-8'),
|
|
||||||
digestmod=hashlib.sha256).hexdigest()
|
|
||||||
|
|
||||||
if client_id and client_secret and token:
|
if client_id and client_secret and token:
|
||||||
return {
|
return {
|
||||||
'client_id': client_id,
|
'client_id': client_id,
|
||||||
'client_secret': client_secret,
|
'client_secret': client_secret,
|
||||||
'token': token,
|
'token': token,
|
||||||
'appsecret_proof': appsecret_proof,
|
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
raise utils_exceptions.ServiceError(data={
|
raise utils_exceptions.ServiceError(data={
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user