From d155e8afa93a1ed503b15ed414609fd21743061f Mon Sep 17 00:00:00 2001 From: lloydzhou Date: Thu, 28 Dec 2023 21:07:55 +0800 Subject: [PATCH] feat: add session --- server/app.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/app.py b/server/app.py index 3a6286c7..5ac3ba3d 100644 --- a/server/app.py +++ b/server/app.py @@ -3,9 +3,10 @@ from connectai.lark.oauth import Server as OauthServer from connectai.lark.sdk import Bot, MarketBot from connectai.lark.webhook import LarkServer -from flask import Flask +from flask import Flask, session app = Flask(__name__) +app.secret_key = (os.environ.get("SECRET_KEY"),) hook = LarkServer(prefix="/api/feishu/hook") oauth = OauthServer(prefix="/api/feishu/oauth") @@ -29,6 +30,8 @@ def on_text_message(bot, message_id, content, *args, **kwargs): def on_oauth_user_info(bot, event_id, user_info, *args, **kwargs): # oauth user_info print("oauth", user_info) + # TODO + session["user_id"] = user_info["union_id"] return user_info