code: def unauth(request):
      
      if check_key(request):
          api = get_api(request)
          request.session.clear()
          logout(request)
      return HttpResponseRedirect(reverse('main'))
docs: logout and remove all session data