
    Uњh                     B    S SK Jr  S SKJr  S SKJrJr   " S S\5      rg)    )app_settings)get_adapter)OAuth2ClientOAuth2Errorc                   "    \ rS rSrSrSS jrSrg)UntappdOAuth2Client   z
Custom client because Untappd:
    * uses redirect_url instead of redirect_uri
    * nests access_token inside an extra 'response' object
Nc                 `   SSK Jn  U R                  U R                  SSU R                  US.nS nU R                  U5        U R                  nU R                  S:X  a  UnS nU(       a  U(       a  X$S'   [        R                  R                  UR                  0 5      nSUR                  S	S
5      0n[        5       R                  5       R                  U R                  UUUUS9n	S n
U	R                  S:X  a  U	R!                  5       S   n
U
(       a  SU
;  a  [#        SU	R$                  -  5      eU
$ )Nr   )UntappdProviderauthorization_codecode)	client_idredirect_url
grant_typeresponse_typeclient_secretr   GETcode_verifierz
User-Agent
USER_AGENTzdjango-allauth)paramsdataheaders   responseaccess_tokenz!Error retrieving access token: %s)0allauth.socialaccount.providers.untappd.providerr   consumer_keycallback_urlconsumer_secret_strip_empty_keysaccess_token_urlaccess_token_methodr   	PROVIDERSgetidr   get_requests_sessionrequeststatus_codejsonr   content)selfr   pkce_code_verifierr   r   r   urlsettingsr   respr   s              iD:\Anime\Ugyen\janka_web_project\venv\Lib\site-packages\allauth/socialaccount/providers/untappd/client.pyget_access_token$UntappdOAuth2Client.get_access_token   s/   T ** --.#!11
 t$####u,FD&$6!))--o.@.@"El<L!MN M!!#W((   	 s"99;z2L~\AADLLPQQ     )N)__name__
__module____qualname____firstlineno____doc__r1   __static_attributes__r4   r3   r0   r   r      s    'r3   r   N)allauth.socialaccountr   allauth.socialaccount.adapterr   -allauth.socialaccount.providers.oauth2.clientr   r   r   r4   r3   r0   <module>r>      s    . 5 S., .r3   