Enhance API key handling in settings and vocab services: Update key retrieval logic to improve validation and status reporting. Introduce new localization strings for key status messages in English, German, and Spanish. Update LanguageAssistantView to display key status dynamically, enhancing user feedback on API key management.
This commit is contained in:
@@ -12,7 +12,6 @@ import UserParam from '../models/community/user_param.js';
|
||||
import { sequelize } from '../utils/sequelize.js';
|
||||
import { notifyUser } from '../utils/socket.js';
|
||||
import { Op } from 'sequelize';
|
||||
import { decrypt } from '../utils/encryption.js';
|
||||
|
||||
export default class VocabService {
|
||||
async _getUserByHashedId(hashedUserId) {
|
||||
@@ -56,7 +55,7 @@ export default class VocabService {
|
||||
}
|
||||
}
|
||||
|
||||
const decryptedKey = keyRow?.value ? decrypt(keyRow.value) : null;
|
||||
const decryptedKey = keyRow?.value ? String(keyRow.value).trim() : null;
|
||||
const hasKey = Boolean(decryptedKey && String(decryptedKey).trim());
|
||||
const enabled = parsed.enabled !== false;
|
||||
const baseUrl = String(parsed.baseUrl || '').trim();
|
||||
|
||||
Reference in New Issue
Block a user