Sızmış parolalar
Have I Been Pwned'i bir Server Action'dan sorgulayın.
← Tüm örnekler·pwned
Önizleme
// app/signup/pwned-action.ts
"use server";
import { checkPwned, type PwnedResult } from "@virastack/password/pwned";
// From the server, Have I Been Pwned never sees the user's IP.
// Only the first 5 characters of the SHA-1 hash are sent.
export async function checkPassword(password: string): Promise<PwnedResult> {
return checkPwned(password, { timeout: 3000 });
}Detaylar
- Sunucudan yalnızca SHA-1 özetinin ilk 5 karakteri çıkar.
- Sunucudan çağırmak kullanıcının IP'sini HIBP'den uzak tutar.
- Herhangi bir hatada durum unknown olur; kullanıcıyı engellemeyin.
Hook API için useViraPassword(), stil ve ikonlar için customization.
