Пример #1
0
 def post(self, request):
     user_info = getattr(request, 'sso_user', None)
     if user_info is None:
         return Response({'success': 1})
     else:
         user_log_out(user_info['data']['account'], request.COOKIES.get('SSO_COOKIE_KEY', ''))
         r = Response({'success': 1})
         r.delete_cookie('SSO_COOKIE_KEY')
         return r
Пример #2
0
def logout(request, response: Response, data: dict):
    if not request.session.is_empty():
        request.session.delete('user')
        response.delete_cookie('sessionid')
        response.data = {'login': '******'}
    return response