wip
This commit is contained in:
parent
da0a156ada
commit
2ad04860a3
2 changed files with 9 additions and 3 deletions
|
@ -74,8 +74,10 @@ def register():
|
||||||
db.session.add(new_user)
|
db.session.add(new_user)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
||||||
flash("Registration successful! You can now log in.", "success")
|
# Log the user in automatically
|
||||||
return redirect(url_for("auth.login"))
|
login_user(new_user)
|
||||||
|
flash("Registration successful! Welcome!", "success")
|
||||||
|
return redirect(url_for("dashboard.dashboard_home"))
|
||||||
|
|
||||||
return render_template("auth/register.html", title="Register")
|
return render_template("auth/register.html", title="Register")
|
||||||
|
|
||||||
|
|
|
@ -10,9 +10,13 @@ bp = Blueprint("dashboard", __name__, url_prefix="/dashboard")
|
||||||
|
|
||||||
|
|
||||||
@bp.route("/")
|
@bp.route("/")
|
||||||
@login_required
|
|
||||||
def dashboard_home():
|
def dashboard_home():
|
||||||
"""Main dashboard view showing server statistics"""
|
"""Main dashboard view showing server statistics"""
|
||||||
|
# Check if user is logged in, redirect if not
|
||||||
|
if not current_user.is_authenticated:
|
||||||
|
flash("Please log in to access this page.", "info")
|
||||||
|
return redirect(url_for('auth.login'))
|
||||||
|
|
||||||
server_count = Server.query.count()
|
server_count = Server.query.count()
|
||||||
app_count = App.query.count()
|
app_count = App.query.count()
|
||||||
subnet_count = Subnet.query.count()
|
subnet_count = Subnet.query.count()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue