
    si                     V    d dl mZ d dlmZ d dlmZ d dlmZ ddlm	Z	  G d de      Z
y	)
    )authenticate)Response)APIView)RefreshToken   )GetEmployeeSerializerc                       e Zd Zd Zy)LoginAPIViewc                    d|j                   j                         v r?|j                   j                  d      }|j                   j                  d      }t        ||      }|rt	        j
                  |      }|j                  }d}d }d}	d }
	 |j                         j                  j                  }	 |j                         j                  j                  }		 |j                  j                  j                  }	 |j                         j                  }
t        |      j                   t        |j                         |||	|
d}t#        |d      S t#        dd	id
      S t#        ddi      S #  Y xY w#  Y xY w#  Y xY w#  Y qxY w)Nusernamepassword)r   r   F)employeeaccessface_detectionface_detection_imagegeo_fencing
company_id   )statuserrorzInvalid credentialsi  z$Please provide Username and Password)datakeysgetr   r   for_useremployee_getget_companyr   startr   imageurlidr   straccess_tokenr   )selfrequestr   r   userrefreshr   r   r   r   r   results               D/var/www/python-projects/worksol/horilla_api/api_views/auth/views.pypostzLoginAPIView.post
   s{   $(9(9(;;||''
3H||''
3HHED&//5,,!&'+$#!
%-%9%9%;%J%J%P%PN"*"6"6"8"D"D"J"JK+3+B+B+H+H+L+L(!)!5!5!7!:!:J !6h ? D D!'"6"67&4,@#.",  s33*? @MMW&LMNN5s0   $E* 2$E1  E8 8E? *E.1E58E<?FN)__name__
__module____qualname__r)        r(   r
   r
   	   s    (Or.   r
   N)django.contrib.authr   rest_framework.responser   rest_framework.viewsr   rest_framework_simplejwt.tokensr    api_serializers.auth.serializersr   r
   r-   r.   r(   <module>r4      s"    , , ( 8 E)O7 )Or.   