Authentication to another page

I want to make authentication to another page on my admin page, when a correct user login that is in the database dictionary, it takes the user to a page called /dashboard.py.

database = {
“admin”:“1234”,
}

callback that checks if login is correct, takes to the admin dashboard

@app.routes(‘/admin’, methods=[‘GET’, ‘POST’])
def check_login():
name1 = request.form[‘username’]
password = request.form[‘password’]
if database[name1] != password:
return ‘/dashboard’
else:
return “

invalid user

”

**edit - I know It would probably be easier to just make a form and use flask to do this, but with strict dash is there any way to do this?