mirror of
https://github.com/balzack/databag.git
synced 2025-03-13 00:50:03 +00:00
big thanks to @mallugamer4k for reporting and debugging this admin login issue!
This commit is contained in:
parent
50c1e07431
commit
97ec0067fc
@ -1,7 +1,7 @@
|
||||
import { checkResponse, fetchWithTimeout } from './fetchUtil';
|
||||
|
||||
export async function addAccountAccess(token, accountId) {
|
||||
let access = await fetchWithTimeout(`/admin/accounts/${accountId}/auth?token=${token}`, { method: 'POST' })
|
||||
let access = await fetchWithTimeout(`/admin/accounts/${accountId}/auth?token=${encodeURIComponent(token)}`, { method: 'POST' })
|
||||
checkResponse(access);
|
||||
return await access.json()
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { checkResponse, fetchWithTimeout } from './fetchUtil';
|
||||
|
||||
export async function addAccountCreate(token) {
|
||||
let access = await fetchWithTimeout(`/admin/accounts?token=${token}`, { method: 'POST' })
|
||||
let access = await fetchWithTimeout(`/admin/accounts?token=${encodeURIComponent(token)}`, { method: 'POST' })
|
||||
checkResponse(access);
|
||||
return await access.json()
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
export function getAccountImageUrl(token, accountId) {
|
||||
return `/admin/accounts/${accountId}/image?token=${token}`
|
||||
return `/admin/accounts/${accountId}/image?token=${encodeURIComponent(token)}`
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { checkResponse, fetchWithTimeout } from './fetchUtil';
|
||||
|
||||
export async function getNodeAccounts(token) {
|
||||
let accounts = await fetchWithTimeout(`/admin/accounts?token=${token}`, { method: 'GET' });
|
||||
let accounts = await fetchWithTimeout(`/admin/accounts?token=${encodeURIComponent(token)}`, { method: 'GET' });
|
||||
checkResponse(accounts);
|
||||
return await accounts.json();
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { checkResponse, fetchWithTimeout } from './fetchUtil';
|
||||
|
||||
export async function getNodeConfig(token) {
|
||||
let config = await fetchWithTimeout(`/admin/config?token=${token}`, { method: 'GET' });
|
||||
let config = await fetchWithTimeout(`/admin/config?token=${encodeURIComponent(token)}`, { method: 'GET' });
|
||||
checkResponse(config);
|
||||
return await config.json();
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { checkResponse, fetchWithTimeout } from './fetchUtil';
|
||||
|
||||
export async function removeAccount(token, accountId) {
|
||||
let res = await fetchWithTimeout(`/admin/accounts/${accountId}?token=${token}`, { method: 'DELETE' })
|
||||
let res = await fetchWithTimeout(`/admin/accounts/${accountId}?token=${encodeURIComponent(token)}`, { method: 'DELETE' })
|
||||
checkResponse(res);
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { checkResponse, fetchWithTimeout } from './fetchUtil';
|
||||
|
||||
export async function setAccountStatus(token, accountId, disabled) {
|
||||
let res = await fetchWithTimeout(`/admin/accounts/${accountId}/status?token=${token}`, { method: 'PUT', body: JSON.stringify(disabled) })
|
||||
let res = await fetchWithTimeout(`/admin/accounts/${accountId}/status?token=${encodeURIComponent(token)}`, { method: 'PUT', body: JSON.stringify(disabled) })
|
||||
checkResponse(res);
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@ import { checkResponse, fetchWithTimeout } from './fetchUtil';
|
||||
|
||||
export async function setNodeConfig(token, config) {
|
||||
let body = JSON.stringify(config);
|
||||
let settings = await fetchWithTimeout(`/admin/config?setOpenAccess=true&token=${token}`, { method: 'PUT', body });
|
||||
let settings = await fetchWithTimeout(`/admin/config?setOpenAccess=true&token=${encodeURIComponent(token)}`, { method: 'PUT', body });
|
||||
checkResponse(settings);
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { checkResponse, fetchWithTimeout } from './fetchUtil';
|
||||
|
||||
export async function setNodeStatus(token) {
|
||||
let status = await fetchWithTimeout(`/admin/status?token=${token}`, { method: 'PUT' });
|
||||
let status = await fetchWithTimeout(`/admin/status?token=${encodeURIComponent(token)}`, { method: 'PUT' });
|
||||
checkResponse(status);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user