delete unused attributes (social auth)

This commit is contained in:
Anatoly 2019-11-07 10:14:48 +03:00
parent 442e4fb2ce
commit ba2b3303bb

View File

@ -1,6 +1,4 @@
"""Common views for application Account"""
import hashlib
import hmac
import json
from braces.views import CsrfExemptMixin
@ -59,16 +57,12 @@ class OAuth2ViewMixin(CsrfExemptMixin, OAuthLibMixin, BaseOAuth2ViewMixin):
client_id = credentials.get('client_id')
client_secret = credentials.get('client_secret')
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:
return {
'client_id': client_id,
'client_secret': client_secret,
'token': token,
'appsecret_proof': appsecret_proof,
}
else:
raise utils_exceptions.ServiceError(data={