Skip to content

Commit

Permalink
feat: add session
Browse files Browse the repository at this point in the history
  • Loading branch information
lloydzhou committed Dec 28, 2023
1 parent c9bc52e commit d155e8a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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


Expand Down

0 comments on commit d155e8a

Please sign in to comment.