示例#1
0
def login():
    if request.method == 'GET':
        return render_template('login.html')

    email = request.form['email']
    password = request.form['password']
    user = User.get(uid=email)

    if user != None and user.check_authenticated(password=password):
        login_user(user)
        return redirect('/')

    return 'Bad login'
示例#2
0
def user_loader(email):
    print('in user_loader')
    return User.get(uid=email)