fix: remove fallback key
This commit is contained in:
parent
22a7547e6c
commit
c63604ac55
@ -181,9 +181,11 @@ export const sendCompletion = async (
|
||||
return encryptedKey
|
||||
}
|
||||
}
|
||||
|
||||
if (!secretKey) {
|
||||
throw new Error('Encryption key unavailable: cannot encrypt API key.')
|
||||
}
|
||||
const apiKey = provider.api_key
|
||||
? decryptApiKey(provider.api_key, secretKey || 'fallback-key')
|
||||
? decryptApiKey(provider.api_key, secretKey)
|
||||
: (secretKey ?? '')
|
||||
|
||||
const tokenJS = new TokenJS({
|
||||
|
||||
@ -536,10 +536,11 @@ function ProviderDetail() {
|
||||
const secretKey = await getServiceHub()
|
||||
.core()
|
||||
.getAppToken()
|
||||
updateObj.api_key = CryptoJS.AES.encrypt(
|
||||
newValue,
|
||||
secretKey || 'fallback-key'
|
||||
).toString()
|
||||
if (secretKey)
|
||||
updateObj.api_key = CryptoJS.AES.encrypt(
|
||||
newValue,
|
||||
secretKey
|
||||
).toString()
|
||||
} else if (
|
||||
settingKey === 'base-url' &&
|
||||
typeof newValue === 'string'
|
||||
@ -555,7 +556,7 @@ function ProviderDetail() {
|
||||
)
|
||||
|
||||
if (deviceSettingIndex !== -1) {
|
||||
(
|
||||
;(
|
||||
newSettings[deviceSettingIndex]
|
||||
.controller_props as {
|
||||
value: string
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user