mirror of
https://github.com/StefBuwalda/ProjectIOT.git
synced 2025-10-30 11:19:57 +00:00
no duplicate entries and added flash messages
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from flask import Blueprint, redirect, url_for, render_template
|
||||
from flask import Blueprint, redirect, url_for, render_template, flash
|
||||
from application.auth.forms import login_form
|
||||
from application.auth.models import User
|
||||
from flask_login import login_user, login_required, logout_user
|
||||
@@ -20,6 +20,7 @@ def login():
|
||||
|
||||
if user and user.check_password(password=password):
|
||||
login_user(user)
|
||||
flash("Succesfully logged in")
|
||||
return redirect(url_for("dash.dashboard"))
|
||||
return render_template("login.html", form=loginForm)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user