add 2fa type tracking to credentials (#3647)

This commit is contained in:
pedrohsdb
2025-10-08 11:38:34 -07:00
committed by GitHub
parent a61ff4cb4f
commit fc0f2b87ca
9 changed files with 123 additions and 6 deletions

View File

@@ -7,6 +7,20 @@ type Props = {
};
function CredentialItem({ credential }: Props) {
const getTotpTypeDisplay = (totpType: string) => {
switch (totpType) {
case "authenticator":
return "Authenticator App";
case "email":
return "Email";
case "text":
return "Text Message";
case "none":
default:
return "";
}
};
return (
<div className="flex gap-5 rounded-lg bg-slate-elevation2 p-4">
<div className="w-48 space-y-2">
@@ -21,10 +35,18 @@ function CredentialItem({ credential }: Props) {
<div className="shrink-0 space-y-2">
<p className="text-sm text-slate-400">Username/Email</p>
<p className="text-sm text-slate-400">Password</p>
{credential.credential.totp_type !== "none" && (
<p className="text-sm text-slate-400">2FA Type</p>
)}
</div>
<div className="space-y-2">
<p className="text-sm">{credential.credential.username}</p>
<p className="text-sm">{"********"}</p>
{credential.credential.totp_type !== "none" && (
<p className="text-sm text-blue-400">
{getTotpTypeDisplay(credential.credential.totp_type)}
</p>
)}
</div>
</div>
</div>