Exemplo n.º 1
0
def password():
    email = request.args.get('email')
    expiration = request.args.get('expires')
    token = request.args.get('token')
    valid_request = verify_link('password', email, expiration, token)
    return render_template('password.html',
        email=email, expiration=expiration, token=token,
        valid_request=valid_request)
Exemplo n.º 2
0
def set_password():
    email = request.form['email']
    expiration = request.form['expires']
    token = request.form['token']
    print email, expiration, token
    valid_request = verify_link('password', email, expiration, token)
    if not valid_request:
        return 'This password reset link has expired', 409
    if not User.registered(email):
        return 'Email address is not registered', 409
    password = request.form['password']
    User.update_password(email, password)
    return email