Add AWS secret key validation.

This commit is contained in:
glay 2024-11-13 08:10:10 +08:00 committed by GitHub
parent 70f066c15f
commit 1b5a81c7ad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1021,9 +1021,14 @@ export function Settings() {
type="text"
placeholder={Locale.Settings.Access.Bedrock.SecretKey.Placeholder}
onChange={(e) => {
accessStore.update(
(access) => (access.awsSecretKey = e.currentTarget.value),
);
accessStore.update((access) => {
const secretKey = e.currentTarget.value;
if (secretKey && secretKey.length !== 40) {
showToast(Locale.Settings.Access.Bedrock.SecretKey.Invalid);
return;
}
access.awsSecretKey = secretKey;
});
}}
maskWhenShow={true}
/>