Example #1
0
File: auth.py Project: dbaty/Lasco
def login(request):
    app_url = request.application_url
    next = request.POST.get('next', '') or app_url
    who_api = get_who_api(request)
    creds = {'login': request.POST['login'],
             'password': request.POST['password']}
    authenticated, headers = who_api.login(creds)
    if not authenticated:
        return login_form(request, failed=True)
    return HTTPSeeOther(location=unquote_plus(next), headers=headers)
Example #2
0
File: auth.py Project: dbaty/Lasco
def logout(request):
    who_api = get_who_api(request)
    headers = who_api.logout()
    return HTTPSeeOther(location=request.application_url, headers=headers)