refac
This commit is contained in:
1 parent
5cc55e2278
commit
678c44c7cd
12 files changed
+268
-76
No files matched your search
@@ -712,3 +712,33 @@ export const deleteAPIKey = async (token: string) => {
|
||||
}
|
||||
return res;
|
||||
};
|
||||
|
||||
export const deleteOAuthSession = async (token: string, provider: string) => {
|
||||
let error = null;
|
||||
|
||||
const res = await fetch(
|
||||
`${WEBUI_API_BASE_URL}/auths/oauth/sessions/${encodeURIComponent(provider)}`,
|
||||
{
|
||||
method: 'DELETE',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: `Bearer ${token}`
|
||||
}
|
||||
}
|
||||
)
|
||||
.then(async (res) => {
|
||||
if (!res.ok) throw await res.json();
|
||||
return res.json();
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err);
|
||||
error = err.detail;
|
||||
return null;
|
||||
});
|
||||
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
return res;
|
||||
};
|
||||
@@ -647,3 +647,4 @@ export const setBanners = async (token: string, banners: Banner[]) => {
|
||||
|
||||
return res;
|
||||
};
|
||||
|
||||
@@ -483,3 +483,4 @@ export const updateUserValvesById = async (token: string, id: string, valves: ob
|
||||
|
||||
return res;
|
||||
};
|
||||
|
||||
@@ -550,3 +550,4 @@ export const getUserGroupsById = async (token: string, userId: string) => {
|
||||
|
||||
return res;
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user