mirror of
https://github.com/Qortal/Qortal-Hub.git
synced 2025-07-29 21:21:24 +00:00
Merge pull request #119 from Qortal/feature/remove-apikey-storage
ability to remove apikey from storage
This commit is contained in:
@@ -202,6 +202,8 @@ export const NotAuthenticated = ({
|
||||
hasLocalNodeRef.current = hasLocalNode;
|
||||
}, [hasLocalNode]);
|
||||
|
||||
console.log('apiKey', apiKey);
|
||||
|
||||
const validateApiKey = useCallback(async (key, fromStartUp) => {
|
||||
try {
|
||||
if (key === 'isGateway') return;
|
||||
@@ -1102,6 +1104,55 @@ export const NotAuthenticated = ({
|
||||
onChange={handleFileChangeApiKey} // File input handler
|
||||
/>
|
||||
</Button>
|
||||
{(apiKey || importedApiKey) && (
|
||||
<Button
|
||||
disabled={!!enteredApiKey}
|
||||
variant="contained"
|
||||
component="label"
|
||||
onClick={() => {
|
||||
setImportedApiKey(null);
|
||||
setCustomNodes((prev) => {
|
||||
const copyPrev = [...prev];
|
||||
const findLocalIndex = copyPrev?.findIndex(
|
||||
(item) => item?.url === 'http://127.0.0.1:12391'
|
||||
);
|
||||
if (findLocalIndex === -1) {
|
||||
copyPrev.unshift({
|
||||
url: 'http://127.0.0.1:12391',
|
||||
apikey: '',
|
||||
});
|
||||
} else {
|
||||
copyPrev[findLocalIndex] = {
|
||||
url: 'http://127.0.0.1:12391',
|
||||
apikey: '',
|
||||
};
|
||||
}
|
||||
window
|
||||
.sendMessage('setCustomNodes', copyPrev)
|
||||
.catch((error) => {
|
||||
console.error(
|
||||
'Failed to set custom nodes:',
|
||||
error.message ||
|
||||
t('core:message.error.generic', {
|
||||
postProcess: 'capitalizeFirstChar',
|
||||
})
|
||||
);
|
||||
});
|
||||
return copyPrev;
|
||||
});
|
||||
setCurrentNode({
|
||||
url: 'http://127.0.0.1:12391',
|
||||
});
|
||||
setUseLocalNode(false);
|
||||
setApiKey(null);
|
||||
handleSetGlobalApikey(null);
|
||||
}}
|
||||
>
|
||||
{t('auth:apikey.clear_storage', {
|
||||
postProcess: 'capitalizeFirstChar',
|
||||
})}
|
||||
</Button>
|
||||
)}
|
||||
</Box>
|
||||
</DialogContent>
|
||||
|
||||
|
@@ -44,7 +44,8 @@
|
||||
"enter": "إدخال مفتاح API",
|
||||
"import": "استيراد مفتاح API",
|
||||
"key": "مفتاح API",
|
||||
"select_valid": "اختر مفتاح API صالح"
|
||||
"select_valid": "اختر مفتاح API صالح",
|
||||
"clear_storage": "إزالة من التخزين"
|
||||
},
|
||||
"authentication": "المصادقة",
|
||||
"blocked_users": "المستخدمون المحظورون",
|
||||
|
@@ -44,7 +44,8 @@
|
||||
"enter": "API-Schlüssel eingeben",
|
||||
"import": "API-Schlüssel importieren",
|
||||
"key": "API-Schlüssel",
|
||||
"select_valid": "Gültigen API-Schlüssel auswählen"
|
||||
"select_valid": "Gültigen API-Schlüssel auswählen",
|
||||
"clear_storage": "aus dem Speicher löschen"
|
||||
},
|
||||
"authentication": "Authentifizierung",
|
||||
"blocked_users": "blockierte Benutzer",
|
||||
|
@@ -44,7 +44,8 @@
|
||||
"enter": "enter APIkey",
|
||||
"import": "import APIkey",
|
||||
"key": "API key",
|
||||
"select_valid": "select a valid apikey"
|
||||
"select_valid": "select a valid apikey",
|
||||
"clear_storage": "clear from storage"
|
||||
},
|
||||
"authentication": "authentication",
|
||||
"blocked_users": "blocked users",
|
||||
|
@@ -1,21 +1,21 @@
|
||||
{
|
||||
"1_getting_started": "1. Primeiros Passos",
|
||||
"2_overview": "2. Visão Geral",
|
||||
"3_groups": "3. Grupos do Qortal",
|
||||
"4_obtain_qort": "4. Obtendo QORT",
|
||||
"account_creation": "criação de conta",
|
||||
"important_info": "informações importantes",
|
||||
"1_getting_started": "1. Getting Started",
|
||||
"2_overview": "2. Overview",
|
||||
"3_groups": "3. Qortal Groups",
|
||||
"4_obtain_qort": "4. Obtaining Qort",
|
||||
"account_creation": "account creation",
|
||||
"important_info": "important information",
|
||||
"apps": {
|
||||
"dashboard": "1. Painel de Aplicativos",
|
||||
"navigation": "2. Navegação de Aplicativos"
|
||||
"dashboard": "1. Apps Dashboard",
|
||||
"navigation": "2. Apps Navigation"
|
||||
},
|
||||
"initial": {
|
||||
"recommended_qort_qty": "tenha pelo menos {{ quantity }} QORT na sua carteira",
|
||||
"explore": "explorar",
|
||||
"general_chat": "chat geral",
|
||||
"getting_started": "primeiros passos",
|
||||
"register_name": "registrar um nome",
|
||||
"see_apps": "ver aplicativos",
|
||||
"trade_qort": "trocar QORT"
|
||||
"recommended_qort_qty": "have at least {{ quantity }} QORT in your wallet",
|
||||
"explore": "explore",
|
||||
"general_chat": "general chat",
|
||||
"getting_started": "getting started",
|
||||
"register_name": "register a name",
|
||||
"see_apps": "see apps",
|
||||
"trade_qort": "trade QORT"
|
||||
}
|
||||
}
|
||||
|
@@ -44,7 +44,8 @@
|
||||
"enter": "ingresar clave API",
|
||||
"import": "importar clave API",
|
||||
"key": "clave API",
|
||||
"select_valid": "selecciona una clave API válida"
|
||||
"select_valid": "selecciona una clave API válida",
|
||||
"clear_storage": "borrar del almacenamiento"
|
||||
},
|
||||
"authentication": "autenticación",
|
||||
"blocked_users": "usuarios bloqueados",
|
||||
|
@@ -44,7 +44,8 @@
|
||||
"enter": "entrer la clé API",
|
||||
"import": "importer la clé API",
|
||||
"key": "clé API",
|
||||
"select_valid": "sélectionner une clé API valide"
|
||||
"select_valid": "sélectionner une clé API valide",
|
||||
"clear_storage": "effacer du stockage"
|
||||
},
|
||||
"authentication": "authentification",
|
||||
"blocked_users": "utilisateurs bloqués",
|
||||
|
@@ -44,7 +44,8 @@
|
||||
"enter": "inserisci Apikey",
|
||||
"import": "importa apikey",
|
||||
"key": "chiave API",
|
||||
"select_valid": "seleziona una apikey valida"
|
||||
"select_valid": "seleziona una apikey valida",
|
||||
"clear_storage": "rimuovi dalla memoria"
|
||||
},
|
||||
"authentication": "autenticazione",
|
||||
"blocked_users": "utenti bloccati",
|
||||
|
@@ -44,7 +44,8 @@
|
||||
"enter": "APIキーを入力",
|
||||
"import": "APIキーをインポート",
|
||||
"key": "APIキー",
|
||||
"select_valid": "有効なAPIキーを選択してください"
|
||||
"select_valid": "有効なAPIキーを選択してください",
|
||||
"clear_storage": "ストレージから削除"
|
||||
},
|
||||
"authentication": "認証",
|
||||
"blocked_users": "ブロックされたユーザー",
|
||||
|
@@ -44,7 +44,8 @@
|
||||
"enter": "digitar APIkey",
|
||||
"import": "importar APIkey",
|
||||
"key": "API key",
|
||||
"select_valid": "selecionar uma APIkey válida"
|
||||
"select_valid": "selecionar uma APIkey válida",
|
||||
"clear_storage": "limpar do armazenamento"
|
||||
},
|
||||
"authentication": "autenticação",
|
||||
"blocked_users": "usuarios bloqueados",
|
||||
|
@@ -44,7 +44,8 @@
|
||||
"enter": "введите API-ключ",
|
||||
"import": "импортировать API-ключ",
|
||||
"key": "API-ключ",
|
||||
"select_valid": "выберите допустимый API-ключ"
|
||||
"select_valid": "выберите допустимый API-ключ",
|
||||
"clear_storage": "удалить из хранилища"
|
||||
},
|
||||
"authentication": "аутентификация",
|
||||
"blocked_users": "заблокированные пользователи",
|
||||
|
@@ -44,7 +44,8 @@
|
||||
"enter": "输入 API 密钥",
|
||||
"import": "导入 API 密钥",
|
||||
"key": "API 密钥",
|
||||
"select_valid": "请选择一个有效的 API 密钥"
|
||||
"select_valid": "请选择一个有效的 API 密钥",
|
||||
"clear_storage": "从存储中清除"
|
||||
},
|
||||
"authentication": "身份验证",
|
||||
"blocked_users": "已屏蔽用户",
|
||||
|
Reference in New Issue
Block a user