示例#1
0
文件: kotodo.py 项目: Irchiel/kotodo
def index():
    username = request.get_cookie('U', secret=secret())
    password = request.get_cookie('P', secret=secret())
    if check_user(username, password):
        return template('todo')
    else:
        return template('login', error=None)
示例#2
0
文件: kotodo.py 项目: Irchiel/kotodo
def postlogin():
    username = request.forms.get('username')
    password = request.forms.get('password')
    if check_user(username, password):
        response.set_cookie('U', username, secret=secret())
        response.set_cookie('P', password, secret=secret())
        redirect('/')
    else:
        return template('login', error='Wrong username or password. Please try again.')