- @app.route('/login', methods=['POST', 'GET'])
- def login():
- if request.method == "POST":
- x = request.json
- email = x['email']
- password = x['password']
- print("email: "+email)
- print("password: "+password)
- if(check_user(email, password)):
- print("tries to redirect")
- print("--> return redirect(url_for('account'))")
- return redirect(url_for('account'))
- #return render_template("pages/accounts/account.html")
- else:
- print("Connection failed")
- print("--> return redirect(url_for('home'))")
- return redirect(url_for('home'))
- #return redirect(url_for('home', title_message="Error", body_message="Incorrect username or password"))
- #return render_template("pages/home.html", title_message="Error", body_message="Incorrect username or password")
- return render_template("pages/accounts/login.html")
- ''' in terminal:
- -->
- tries to redirect
- --> return redirect(url_for('account'))
- 127.0.0.1 - - [05/May/2021 21:46:00] "POST /login HTTP/1.1" 302 -
- 127.0.0.1 - - [05/May/2021 21:46:01] "GET /favicon.ico HTTP/1.1" 200 -
- '''
[text]
Viewer
*** This page was generated with the meta tag "noindex, nofollow". This happened because you selected this option before saving or the system detected it as spam. This means that this page will never get into the search engines and the search bot will not crawl it. There is nothing to worry about, you can still share it with anyone.
Editor
You can edit this paste and save as new: