3
Ìœ™^`  ã               @   s$   d Z ddlmZ G dd„ deƒZdS )z
Authentication
é    )ÚOAuth2Authenticationc                   s    e Zd ZdZ‡ fdd„Z‡  ZS )ÚHotelAppOAuth2Authenticationz(
    Hotel App OAuth Authentication
    c                s"   t t| ƒj|ƒ}|r|d |_|S )zk
        Returns two-tuple of (user, token) if authentication succeeds,
        or None otherwise.
        r   )Úsuperr   ÚauthenticateÚuser)ÚselfÚrequestZ	user_auth)Ú	__class__© úL/home/hotel/hotelbackend/hotelapplication/hotelmanage/core/authentication.pyr      s
    
z)HotelAppOAuth2Authentication.authenticate)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ú__classcell__r
   r
   )r	   r   r   	   s   r   N)r   Z5oauth2_provider.contrib.rest_framework.authenticationr   r   r
   r
   r
   r   Ú<module>   s   