simple flask app for password redirects
from flask import Flask, redirect | |
app = Flask(__name__) | |
@app.route('/') | |
def hello_world(): | |
return 'Page with password form!' | |
urls = { | |
"googlepass": "https://google.com", | |
"youtubepass": "https://youtube.com" | |
} | |
@app.route('/go', methods=['POST']) | |
def go(): | |
password = request.form.get("password", "") | |
url = urls.get(password, "/404") | |
return redirect(url) | |
@app.route("/404") | |
def oops(): | |
return "Wrong password" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment