@app.route('/', methods=['POST'])
def handle_password():
    (ttl, password) = clean_input()
    token = set_password(password, ttl)
    if NO_SSL:
        base_url = request.url_root
    else:
        base_url = request.url_root.replace('http://', 'https://')
    link = (base_url + url_quote_plus(token))
    return render_template('confirm.html', password_link=link)
@app.route('/', methods=['POST'])
def handle_password():
    (ttl, password) = clean_input()
    token = set_password(password, ttl)
    if NO_SSL:
        base_url = request.url_root
    else:
        base_url = request.url_root.replace('http://', 'https://')
    link = (base_url + url_quote_plus(token))
    return render_template('confirm.html', password_link=link)