mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-11-18 11:36:17 +00:00
Update settings.tsx
This commit is contained in:
@@ -318,7 +318,7 @@ export function Settings() {
|
|||||||
setGeneratingToken(true)
|
setGeneratingToken(true)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetchApi("/api/auth/generate-api-token", {
|
const data = await fetchApi("/api/auth/generate-api-token", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: { "Content-Type": "application/json" },
|
headers: { "Content-Type": "application/json" },
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
@@ -327,9 +327,7 @@ export function Settings() {
|
|||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
|
|
||||||
const data = await response.json()
|
if (!data.success) {
|
||||||
|
|
||||||
if (!response.ok || !data.success) {
|
|
||||||
setError(data.message || data.error || "Failed to generate API token")
|
setError(data.message || data.error || "Failed to generate API token")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user