+Fix On user in login not there it makes an error. +Added On user or pass incorect make indicator.
This commit is contained in:
parent
321923b056
commit
cffe60b109
4 changed files with 64 additions and 6 deletions
|
|
@ -69,8 +69,7 @@ def login():
|
|||
form = LoginForm()
|
||||
if form.validate_on_submit():
|
||||
user = user_loader(form.username.data)
|
||||
#TODO if username not in User:
|
||||
#TODO return if username or pass wrong a red textbox in ui...
|
||||
|
||||
if user and compare.is_user_pass_valid(form.username.data, form.password.data):
|
||||
login_user(user) # store user id in session
|
||||
|
||||
|
|
@ -82,8 +81,9 @@ def login():
|
|||
#next = request.args.get('next') is written in documentaion FLASK
|
||||
#return redirect(next, url_for('orders')) # redirect to orders page
|
||||
return redirect(url_for('orders')) # redirect to orders page
|
||||
#return wrong_user_pass.html a indexer for wrong pass or username
|
||||
return render_template('partials/_wrong_user_pass.html', form=form)
|
||||
return render_template('login.html', form=form)
|
||||
|
||||
@app.route("/logout") #TODO make a button
|
||||
@login_required
|
||||
def logout():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue