from firebase_admin import auth
@app.route("/admin/dashboard")
def admin_dashboard():
current_user = auth.get_user(request.cookies.get("session"))
# If the user is not authenticated, redirect to the login page
if not current_user:
return redirect(url_for('/admin/login'))
return render_template("admin/dashboard.html")
我收到以下错误“当前用户= auth.get用户(请求. cookie.get(“会话”))属性错误:“Auth”对象没有属性“get_user”“
1条答案
按热度按时间lvjbypge1#
您需要在模块
auth
中使用类Client:更多详细信息请参见here