Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(backend): allow to warp the token #975

Merged
merged 2 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions backend/refresh_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import httpx
import streamlit as st
from streamlit_extras.stylable_container import stylable_container


session = httpx.AsyncClient()
Expand Down Expand Up @@ -81,7 +82,11 @@ async def main():

if refresh_token:
st.success("refresh token 获取成功", icon="✅")
st.code(refresh_token, language=None)
with stylable_container(
"codeblock",
"code { white-space: normal !important; overflow-wrap: anywhere; }",
):
st.code(refresh_token, language=None)

with authcode_tab:
with st.form("authCode"):
Expand All @@ -91,7 +96,11 @@ async def main():
try:
refresh_token = await get_refresh_token(code)
st.success("refresh token 获取成功", icon="✅")
st.code(refresh_token, language=None)
with stylable_container(
"codeblock",
"code { white-space: normal !important; overflow-wrap: anywhere; }",
):
st.code(refresh_token, language=None)
except KeyError:
st.error("无效的 authCode, 请重新获取", icon="🚨")

Expand Down
1 change: 1 addition & 0 deletions backend/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
fastapi>=0.93.0
httpx
streamlit_extras
uvicorn[standard]
Loading