Spaces:
Runtime error
Runtime error
Upload main_app.py
Browse files- main_app.py +21 -23
main_app.py
CHANGED
|
@@ -1411,12 +1411,12 @@ def render_chat_tab_content(managers):
|
|
| 1411 |
st.markdown(f"**現在のシーン**: {current_theme_name}")
|
| 1412 |
|
| 1413 |
# 認証状態の表示
|
| 1414 |
-
|
| 1415 |
-
|
| 1416 |
|
| 1417 |
-
|
| 1418 |
-
|
| 1419 |
-
|
| 1420 |
# ローカルストレージをクリア
|
| 1421 |
execute_js("clearStorage();")
|
| 1422 |
# セッション状態をクリア
|
|
@@ -1425,25 +1425,23 @@ def render_chat_tab_content(managers):
|
|
| 1425 |
st.session_state.token = None
|
| 1426 |
st.rerun()
|
| 1427 |
# ユーザー情報の表示
|
| 1428 |
-
|
| 1429 |
-
|
| 1430 |
|
| 1431 |
-
|
| 1432 |
-
|
| 1433 |
-
|
| 1434 |
-
|
| 1435 |
-
|
| 1436 |
-
|
| 1437 |
-
|
| 1438 |
-
|
| 1439 |
-
|
| 1440 |
-
|
| 1441 |
-
|
| 1442 |
-
|
| 1443 |
-
|
| 1444 |
-
|
| 1445 |
-
with col2:
|
| 1446 |
-
auto_login = st.checkbox("自動ログイン", value=True)
|
| 1447 |
|
| 1448 |
# 認証処理
|
| 1449 |
if auth_button and token_input:
|
|
|
|
| 1411 |
st.markdown(f"**現在のシーン**: {current_theme_name}")
|
| 1412 |
|
| 1413 |
# 認証状態の表示
|
| 1414 |
+
if st.session_state.authenticated:
|
| 1415 |
+
st.success(f"✅ ログイン中: **{st.session_state.user_info.get('name', 'Unknown')}**")
|
| 1416 |
|
| 1417 |
+
col1, col2 = st.columns([3, 1])
|
| 1418 |
+
with col2:
|
| 1419 |
+
if st.button("ログアウト", type="secondary"):
|
| 1420 |
# ローカルストレージをクリア
|
| 1421 |
execute_js("clearStorage();")
|
| 1422 |
# セッション状態をクリア
|
|
|
|
| 1425 |
st.session_state.token = None
|
| 1426 |
st.rerun()
|
| 1427 |
# ユーザー情報の表示
|
| 1428 |
+
with st.expander("ユーザー情報"):
|
| 1429 |
+
st.json(st.session_state.user_info)
|
| 1430 |
|
| 1431 |
+
else:
|
| 1432 |
+
st.info("Hugging Face トークンでログインしてください")
|
| 1433 |
+
|
| 1434 |
+
with st.form("auth_form"):
|
| 1435 |
+
token_input = st.text_input(
|
| 1436 |
+
"Hugging Face Token",
|
| 1437 |
+
type="password",
|
| 1438 |
+
help="https://huggingface.co/settings/tokens からトークンを取得してください"
|
| 1439 |
+
)
|
| 1440 |
+
col1, col2, col3 = st.columns([2, 1, 1])
|
| 1441 |
+
with col1:
|
| 1442 |
+
auth_button = st.form_submit_button("🔑 認証", type="primary")
|
| 1443 |
+
with col2:
|
| 1444 |
+
auto_login = st.checkbox("自動ログイン", value=True)
|
|
|
|
|
|
|
| 1445 |
|
| 1446 |
# 認証処理
|
| 1447 |
if auth_button and token_input:
|