Skip to content

Commit

Permalink
refactor(backend): allow to warp the token (#975)
Browse files Browse the repository at this point in the history
* refactor(backend): allow to warp the token

* sort the package name
  • Loading branch information
yin1999 authored Apr 15, 2024
1 parent 0d8cf30 commit 23d1674
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
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]

0 comments on commit 23d1674

Please sign in to comment.