feat(auth): remove unused backendClaims and simplify verification messages

This commit is contained in:
Nik Afiq 2025-12-11 21:28:05 +09:00
parent 41500eaeff
commit dea090b501
2 changed files with 8 additions and 6 deletions

View File

@ -1,7 +1,7 @@
import { useAuth } from "../auth/AuthProvider"; import { useAuth } from "../auth/AuthProvider";
export default function AuthStatus() { export default function AuthStatus() {
const { enabled, status, user, backendClaims, verifying, signingIn, signInWithGoogle, signOut, error } = useAuth(); const { enabled, status, user, verifying, signingIn, signInWithGoogle, signOut, error } = useAuth();
if (!enabled) { if (!enabled) {
return <div className="auth-chip muted">Auth off</div>; return <div className="auth-chip muted">Auth off</div>;
@ -25,9 +25,11 @@ export default function AuthStatus() {
{user.photoURL && <img src={user.photoURL} alt="" className="auth-avatar" referrerPolicy="no-referrer" />} {user.photoURL && <img src={user.photoURL} alt="" className="auth-avatar" referrerPolicy="no-referrer" />}
<div className="auth-meta"> <div className="auth-meta">
<div className="auth-name">{user.displayName || user.email || user.uid}</div> <div className="auth-name">{user.displayName || user.email || user.uid}</div>
{verifying && (
<div className="auth-subtle"> <div className="auth-subtle">
{verifying ? "確認中…" : backendClaims ? "バックエンド認証済み" : "未確認"}
</div> </div>
)}
{error && <div className="auth-error">{error}</div>} {error && <div className="auth-error">{error}</div>}
</div> </div>
<button className="auth-signout" onClick={() => signOut().catch(() => { })}></button> <button className="auth-signout" onClick={() => signOut().catch(() => { })}></button>

View File

@ -318,7 +318,7 @@ export default function ShowsPage() {
{isAuthed && ( {isAuthed && (
<span style={{ color: backendClaims ? "#6de3a2" : "#f0d000" }}> <span style={{ color: backendClaims ? "#6de3a2" : "#f0d000" }}>
{" "} {verifying ? "トークン確認中…" : backendClaims ? "バックエンドで確認済み" : "未確認トークン"} {" "} {verifying ? "トークン確認中…" : backendClaims ? "サインイン済み" : "未確認トークン"}
</span> </span>
)} )}
</span> </span>
@ -372,7 +372,7 @@ export default function ShowsPage() {
<div className="selection-title">{selectedShow.ep_num}{selectedShow.ep_title}</div> <div className="selection-title">{selectedShow.ep_num}{selectedShow.ep_title}</div>
<div className="selection-note"> <div className="selection-note">
{idToken {idToken
? (verifying ? "トークン確認中…" : backendClaims ? "バックエンドで確認済み" : "バックエンド未確認") ? (verifying ? "トークン確認中…" : "サインイン済み")
: "削除にはサインインが必要です(サイドバー下部の管理用サインインから)"} : "削除にはサインインが必要です(サイドバー下部の管理用サインインから)"}
</div> </div>
</div> </div>