⏪ Rollback server side set cookie
This commit is contained in:
@ -131,7 +131,6 @@ async function readTickets({ page, itemsPerPage }: { page?: number; itemsPerPage
|
||||
}),
|
||||
{
|
||||
headers: { Authorization: `Bearer ${useAtk().value}` },
|
||||
credentials: "include",
|
||||
},
|
||||
)
|
||||
if (res.status !== 200) {
|
||||
@ -157,7 +156,6 @@ async function readEvents({ page, itemsPerPage }: { page?: number; itemsPerPage?
|
||||
}),
|
||||
{
|
||||
headers: { Authorization: `Bearer ${useAtk().value}` },
|
||||
credentials: "include",
|
||||
},
|
||||
)
|
||||
if (res.status !== 200) {
|
||||
@ -177,7 +175,6 @@ async function killTicket(item: any) {
|
||||
const res = await fetch(`${config.public.solarNetworkApi}/cgi/auth/users/me/tickets/${item.id}`, {
|
||||
method: "DELETE",
|
||||
headers: { Authorization: `Bearer ${useAtk().value}` },
|
||||
credentials: "include",
|
||||
})
|
||||
if (res.status !== 200) {
|
||||
error.value = await res.text()
|
||||
|
@ -16,6 +16,7 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from "vue"
|
||||
import { useRoute, useRouter } from "vue-router"
|
||||
import { setTokenSet } from "~/stores/userinfo"
|
||||
|
||||
const config = useRuntimeConfig()
|
||||
|
||||
@ -51,6 +52,8 @@ async function getToken(tk: string) {
|
||||
error.value = err
|
||||
throw new Error(err)
|
||||
} else {
|
||||
const out = await res.json()
|
||||
setTokenSet(out["access_token"], out["refresh_token"])
|
||||
error.value = null
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user