🐛 User related requests enable with credentials to prevent some errors
This commit is contained in:
parent
b18735643e
commit
6162f8f891
@ -131,6 +131,7 @@ async function readTickets({ page, itemsPerPage }: { page?: number; itemsPerPage
|
||||
}),
|
||||
{
|
||||
headers: { Authorization: `Bearer ${getAtk()}` },
|
||||
credentials: "include",
|
||||
},
|
||||
)
|
||||
if (res.status !== 200) {
|
||||
@ -156,6 +157,7 @@ async function readEvents({ page, itemsPerPage }: { page?: number; itemsPerPage?
|
||||
}),
|
||||
{
|
||||
headers: { Authorization: `Bearer ${getAtk()}` },
|
||||
credentials: "include",
|
||||
},
|
||||
)
|
||||
if (res.status !== 200) {
|
||||
@ -175,6 +177,7 @@ async function killTicket(item: any) {
|
||||
const res = await fetch(`${config.public.solarNetworkApi}/cgi/auth/users/me/tickets/${item.id}`, {
|
||||
method: "DELETE",
|
||||
headers: { Authorization: `Bearer ${getAtk()}` },
|
||||
credentials: "include",
|
||||
})
|
||||
if (res.status !== 200) {
|
||||
error.value = await res.text()
|
||||
|
@ -90,6 +90,7 @@ const panel = ref("confirm")
|
||||
async function tryAuthorize() {
|
||||
const res = await fetch(`${config.public.solarNetworkApi}/cgi/auth/auth/o/authorize` + window.location.search, {
|
||||
headers: { Authorization: `Bearer ${getAtk()}` },
|
||||
credentials: "include",
|
||||
})
|
||||
|
||||
if (res.status !== 200) {
|
||||
@ -123,6 +124,7 @@ async function approve() {
|
||||
const res = await fetch(`${config.public.solarNetworkApi}/cgi/auth/auth/o/authorize` + window.location.search, {
|
||||
method: "POST",
|
||||
headers: { Authorization: `Bearer ${getAtk()}` },
|
||||
credentials: "include",
|
||||
})
|
||||
|
||||
if (res.status !== 200) {
|
||||
|
@ -40,6 +40,7 @@ export const useUserinfo = defineStore("userinfo", () => {
|
||||
|
||||
const res = await fetch(`${config.public.solarNetworkApi}/cgi/auth/users/me`, {
|
||||
headers: { Authorization: `Bearer ${getAtk()}` },
|
||||
credentials: "include",
|
||||
})
|
||||
|
||||
if (res.status !== 200) {
|
||||
|
Loading…
Reference in New Issue
Block a user