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?