예제 #1
0
파일: auth.py 프로젝트: dbaty/Petrel
def login(request):
    next = request.POST.get('next', '') or request.application_url
    who_api = get_who_api(request.environ)
    creds = {'login': request.POST['login'],
             'password': request.POST['password']}
    authenticated, headers = who_api.login(creds)
    if not authenticated:
        return login_form(request, error=u'Wrong user name or password.')
    return HTTPSeeOther(location=unquote_plus(next), headers=headers)
예제 #2
0
파일: auth.py 프로젝트: dbaty/Petrel
def logout(request):
    who_api = get_who_api(request.environ)
    headers = who_api.logout()
    return HTTPSeeOther(location=request.application_url, headers=headers)