Ë
    +Ñ¦hÈ  ã                   ó”   — d dl mZmZ d dlmZ d dlmZ d dlm	Z	m
Z
 dZde› �Z G d„ de
«      Z	 	 dd
d	d	d	d	d	d	d	d	dœ	d„Z ed„ «      Zy	)é    )ÚgÚrequest)Ú
LocalProxy)Ú__version__)ÚOAuth2ConsumerBlueprintÚOAuth2Sessionz%Jimmy Hedman <jimmy.hedman@gmail.com>zFlask-Dance/c                   ó   ‡ — e Zd Zˆ fd„Zˆ xZS )ÚStravaOAuth2Sessionc                 ód   •— t        ‰| �  |ddt        j                  j	                  d«      dœ|¤ŽS )NTÚPOSTÚcode)Úinclude_client_idÚmethodr   )ÚsuperÚfetch_tokenr   ÚargsÚget)Úselfr   ÚkwargsÚ	__class__s      €úR/var/www/timesheet/venv/lib/python3.12/site-packages/flask_dance/contrib/strava.pyr   zStravaOAuth2Session.fetch_token   s>   ø€ ä‰wÑ"ð ð #ØÜ—‘×!Ñ! &Ó)ñ
ð
 ñ
ð 	
ó    )Ú__name__Ú
__module__Ú__qualname__r   Ú__classcell__)r   s   @r   r
   r
      s   ø„ ÷
ð 
r   r
   NÚread)	ÚscopeÚredirect_urlÚredirect_toÚ	login_urlÚauthorized_urlÚsession_classÚstorageÚ
user_agentÚrule_kwargsc       	         óÈ   ‡— t        dt        | ||dddd|||||xs t        ||
¬«      Šd‰j                  d<   d‰j                  d	<   |	‰_        ‰j
                  ˆfd
„«       }‰S )añ  
    Make a blueprint for authenticating with Strava using OAuth 2. This requires
    a client ID and client secret from Strava. You should either pass them to
    this constructor, or make sure that your Flask application config defines
    them, using the variables :envvar:`STRAVA_OAUTH_CLIENT_ID` and
    :envvar:`STRAVA_OAUTH_CLIENT_SECRET`.

    Args:
        client_id (str): The client ID for your application on Strava.
        client_secret (str): The client secret for your application on Strava
        scope (str, optional): space-separated list of scopes for the OAuth token
            Defaults to ``identity``
        redirect_url (str): the URL to redirect to after the authentication
            dance is complete
        redirect_to (str): if ``redirect_url`` is not defined, the name of the
            view to redirect to after the authentication dance is complete.
            The actual URL will be determined by :func:`flask.url_for`
        login_url (str, optional): the URL path for the ``login`` view.
            Defaults to ``/strava``
        authorized_url (str, optional): the URL path for the ``authorized`` view.
            Defaults to ``/strava/authorized``.
        session_class (class, optional): The class to use for creating a
            Requests session. Defaults to
            :class:`~flask_dance.contrib.strava.StravaOAuth2Session`.
        storage: A token storage class, or an instance of a token storage
            class, to use for this blueprint. Defaults to
            :class:`~flask_dance.consumer.storage.session.SessionStorage`.
        user_agent (str, optional): User agent for the requests to Strava API.
            Defaults to ``Flask-Dance/{{version}}``.
        rule_kwargs (dict, optional): Additional arguments that should be passed when adding
            the login and authorized routes. Defaults to ``None``.

    :rtype: :class:`~flask_dance.consumer.OAuth2ConsumerBlueprint`
    :returns: A :doc:`blueprint <flask:blueprints>` to attach to your Flask app.
    Ústravazhttps://www.strava.com/api/v3z-https://www.strava.com/api/v3/oauth/authorizez)https://www.strava.com/api/v3/oauth/token)Ú	client_idÚclient_secretr   Úbase_urlÚauthorization_urlÚ	token_urlÚauto_refresh_urlr   r    r!   r"   r#   r$   r&   ÚSTRAVA_OAUTH_CLIENT_IDr)   ÚSTRAVA_OAUTH_CLIENT_SECRETr*   c                  ó0   •— ‰ j                   t        _        y ©N)Úsessionr   Úflask_dance_strava)Ú	strava_bps   €r   Úset_applocal_sessionz3make_strava_blueprint.<locals>.set_applocal_sessionc   s   ø€ à(×0Ñ0ŒÕr   )r   r   r
   Úfrom_configr%   Úbefore_app_request)r)   r*   r   r   r    r!   r"   r#   r$   r%   r&   r6   r5   s               @r   Úmake_strava_blueprintr9      s‘   ø€ ôd (ØÜØØ#ØØ0ØIØ=ØDØ!ØØØ%Ø#Ò:Ô':ØØô!€Ið& *B€I×Ñ˜+Ñ&Ø-I€I×Ñ˜/Ñ*à%€IÔà×!Ñ!ó1ó "ð1ð Ðr   c                  ó"   — t         j                  S r2   )r   r4   © r   r   ú<lambda>r<   j   s   € œA×0Ñ0€ r   )NN)Úflaskr   r   Úwerkzeug.localr   Úflask_dancer   Ú_flask_dance_versionÚflask_dance.consumerr   r   Ú__maintainer__ÚDEFAULT_USER_AGENTr
   r9   r(   r;   r   r   ú<module>rD      sr   ðß Ý %å ;ß Gà8€ð $Ð$8Ð#9Ð:Ð ô	
˜-ô 	
ð ØðNð ØØØØØØØØôNñb 
Ñ0Ó	1�r   