fix: migrate PIN hashing from SHA-256 to Argon2id (#54) #55

Merged
maximus merged 4 commits from fix/simpl-resultat-54-argon2id-pin into main 2026-04-14 12:49:06 +00:00
2 changed files with 10 additions and 2 deletions
Showing only changes of commit e5be6f5a56 - Show all commits

View file

@ -39,7 +39,11 @@ export default function ProfileSwitcher() {
const handlePinSuccess = async (rehashed?: string | null) => {
if (pinProfile) {
if (rehashed) {
await updateProfile(pinProfile.id, { pin_hash: rehashed });
try {
await updateProfile(pinProfile.id, { pin_hash: rehashed });
} catch {
// Best-effort rehash: don't block profile switch if persistence fails
}
}
switchProfile(pinProfile.id);
setPinProfile(null);

View file

@ -26,7 +26,11 @@ export default function ProfileSelectionPage() {
const handlePinSuccess = async (rehashed?: string | null) => {
if (pinProfileId) {
if (rehashed) {
await updateProfile(pinProfileId, { pin_hash: rehashed });
try {
await updateProfile(pinProfileId, { pin_hash: rehashed });
} catch {
// Best-effort rehash: don't block profile switch if persistence fails
}
}
switchProfile(pinProfileId);
setPinProfileId(null);