Сделал адекватное отображение ключей / и при регистрации ключи спрашивают какие сохранять

(что то работает что то сложно)
This commit is contained in:
AidarKC
2026-03-30 03:11:09 +03:00
parent 089146a137
commit eb5593c7be
35 changed files with 396 additions and 247 deletions
+10 -1
View File
@@ -1,7 +1,7 @@
import {
decryptJsonWithStoragePwd,
encryptJsonWithStoragePwd,
} from './crypto-utils.js?v=20260327192619';
} from './crypto-utils.js?v=20260330001044';
const DB_NAME = 'shine-ui-auth';
const DB_VERSION = 1;
@@ -76,3 +76,12 @@ export async function saveSessionMaterial(login, material) {
export async function loadSessionMaterial(login) {
return get(STORE_SESSIONS, login);
}
export async function clearClientAuthData() {
await new Promise((resolve, reject) => {
const request = indexedDB.deleteDatabase(DB_NAME);
request.onsuccess = () => resolve();
request.onerror = () => reject(request.error || new Error('Не удалось очистить IndexedDB'));
request.onblocked = () => reject(new Error('Очистка IndexedDB заблокирована открытыми соединениями'));
});
}