Permalink
Browse files

feat(naver): Added extract field, email addresses func

  • Loading branch information...
hwshim0810 authored and pennersr committed Jul 16, 2018
1 parent 9a11bed commit 9c31b6576628e9d6971349abc189dfd613d6591e
Showing with 13 additions and 0 deletions.
  1. +1 −0 AUTHORS
  2. +12 −0 allauth/socialaccount/providers/naver/provider.py
@@ -47,6 +47,7 @@ Griffith Rees
Guillaume Vincent
Guoyu Hao
Hatem Nassrat
Hyunwoo Shim
J. Erm
J. Fernando Sánchez
Jack Shedd
@@ -1,3 +1,4 @@
from allauth.account.models import EmailAddress
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider

@@ -19,5 +20,16 @@ class NaverProvider(OAuth2Provider):
def extract_uid(self, data):
return str(data['id'])

def extract_common_fields(self, data):
email = data.get("email")
return dict(email=email)

def extract_email_addresses(self, data):
ret = []
email = data.get("email")
if email:
ret.append(EmailAddress(email=email, verified=True, primary=True))
return ret


provider_classes = [NaverProvider]

0 comments on commit 9c31b65

Please sign in to comment.