from flask import Flask, request, redirect, url_for

app = Flask(__name__)

def index():
    return '<a href="/login">login</a>'

def login_get():
    return '''<form action="/login" method="POST">
            <input name="username">
            <input name="password" type="password">
            <input type="submit" value="Login">

@app.route('/login', methods=['POST'])
def login_post():
    username = request.form.get('username')
    password = request.form.get('password')
    if password is None or username is None:
        return redirect(url_for('login_get'))
    if password == username: # do the real verification here
        return redirect(url_for('user_page', name = username))
    return redirect(url_for('login_get'))

def user_page_central():
    return 'List of users'

def user_page(name):
    return f'Page of {name}'