mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Textgen: Add permissions check for TabbyAPI keys
There's no formal permissions checking in ST's UI, so add a temporary check in the server endpoint before requesting a download. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
@@ -526,7 +526,10 @@ async function downloadTabbyModel() {
|
||||
body: JSON.stringify(params),
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
if (response.status === 403) {
|
||||
toastr.error("The provided key has invalid permissions. Please use an admin key for downloading.");
|
||||
return;
|
||||
} else if (!response.ok) {
|
||||
throw new Error(response.statusText);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user