from flask import Blueprint, jsonify, redirect, url_for, render_template from flask_atlas_auth import current_user core = Blueprint("core", __name__) @core.route("/health") def health(): return jsonify({"status": "ok"}) @core.route("/", methods=["GET"]) def home(): if current_user.is_authenticated: return redirect(url_for("templating.list_templates")) return render_template("home.html") @core.route("/admin/", methods=["GET"]) def admin(): return redirect(url_for("templating.list_templates")) @core.route("/admin/ping", methods=["GET"]) def ping(): """Empty view to refresh token and keep the session.""" return ""