feat: refine passkey login and editable dashboard grid
This commit is contained in:
@@ -41,23 +41,6 @@ export function LoginForm({ className, ...props }: DivProps) {
|
|||||||
if (typeof PublicKeyCredential === "undefined") return;
|
if (typeof PublicKeyCredential === "undefined") return;
|
||||||
|
|
||||||
setPasskeySupported(true);
|
setPasskeySupported(true);
|
||||||
|
|
||||||
if (
|
|
||||||
typeof PublicKeyCredential.isConditionalMediationAvailable === "function"
|
|
||||||
) {
|
|
||||||
PublicKeyCredential.isConditionalMediationAvailable()
|
|
||||||
.then((available) => {
|
|
||||||
if (available) {
|
|
||||||
// Conditional UI é opcional: habilita autofill quando disponível.
|
|
||||||
authClient.signIn.passkey({
|
|
||||||
mediation: "conditional",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
// Ignora falhas de detecção e mantém login manual por passkey.
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
async function handleSubmit(e: FormEvent<HTMLFormElement>) {
|
async function handleSubmit(e: FormEvent<HTMLFormElement>) {
|
||||||
@@ -237,7 +220,7 @@ export function LoginForm({ className, ...props }: DivProps) {
|
|||||||
) : (
|
) : (
|
||||||
<RiFingerprintLine className="h-5 w-5" />
|
<RiFingerprintLine className="h-5 w-5" />
|
||||||
)}
|
)}
|
||||||
<span>Entrar com Passkey</span>
|
<span>Entrar com passkey</span>
|
||||||
</Button>
|
</Button>
|
||||||
</Field>
|
</Field>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -201,9 +201,9 @@ export function DashboardGridEditable({
|
|||||||
{/* Toolbar */}
|
{/* Toolbar */}
|
||||||
<div className="flex flex-wrap items-center justify-between gap-2">
|
<div className="flex flex-wrap items-center justify-between gap-2">
|
||||||
{!isEditing ? (
|
{!isEditing ? (
|
||||||
<div className="flex min-w-0 flex-col gap-1 sm:flex-row sm:items-center sm:gap-2">
|
<div className="flex min-w-0 flex-col gap-1 sm:flex-row sm:items-center sm:gap-2 px-1">
|
||||||
<span className="text-[11px] font-semibold uppercase tracking-wide text-muted-foreground">
|
<span className="text-[11px] font-semibold uppercase tracking-wide text-muted-foreground">
|
||||||
Ação rápida
|
Ações rápidas
|
||||||
</span>
|
</span>
|
||||||
<div className="-mb-1 flex items-center gap-2 overflow-x-auto pb-1 sm:mb-0 sm:overflow-visible sm:pb-0">
|
<div className="-mb-1 flex items-center gap-2 overflow-x-auto pb-1 sm:mb-0 sm:overflow-visible sm:pb-0">
|
||||||
<LancamentoDialog
|
<LancamentoDialog
|
||||||
|
|||||||
Reference in New Issue
Block a user