Example #1
0
def logout(
    request,
    next_page=None
):
    """
        Redirects to CAS logout page
    """
    from django.contrib.auth import logout as app_logout
    app_logout(
        request
    )
    if not next_page:
        next_page = _redirect_url(
            request
        )
    if settings.CAS_LOGOUT_COMPLETELY:
        return HttpResponseRedirect(
            _logout_url(
                request,
                next_page
            )
        )
    else:
        return HttpResponseRedirect(
            next_page
        )
Example #2
0
def logout(request, next_page=None):
    """
        Redirects to CAS logout page
    """
    from django.contrib.auth import logout as app_logout
    app_logout(request)
    if not next_page:
        next_page = _redirect_url(request)
    if settings.CAS_LOGOUT_COMPLETELY:
        return HttpResponseRedirect(_logout_url(request, next_page))
    else:
        return HttpResponseRedirect(next_page)
Example #3
0
def logout(request):
    if request.method == 'POST':
        app_logout(request)
        return HttpResponse('OK')
Example #4
0
def logout(request):
    app_logout(request)
    return redirect("login")
Example #5
0
def logout(request):
    app_logout(request)
    return redirect('http://localhost:8000/')
Example #6
0
 def get(self, request, *args, **kwargs):
     if request.user.is_authenticated():
         app_logout(request)
     return super(LogoutView, self).get(request, *args, **kwargs)
 def post(self, request):
     app_logout(request)
     return Response(status=204)
def submit_logout(request):
    app_logout(request)
    return redirect('login')
Example #9
0
 def post(self, request):
     app_logout(request)
     return JsonResponse({'status': 'ok'})