fix: add missing token checks to request save workflow (#5436)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
a3ca9cab81
commit
76e6c3ae2f
2 changed files with 9 additions and 1 deletions
|
|
@ -154,6 +154,7 @@ import { TeamWorkspace } from "~/services/workspace.service"
|
|||
import IconSparkle from "~icons/lucide/sparkles"
|
||||
import IconThumbsDown from "~icons/lucide/thumbs-down"
|
||||
import IconThumbsUp from "~icons/lucide/thumbs-up"
|
||||
import { handleTokenValidation } from "~/helpers/handleTokenValidation";
|
||||
|
||||
const t = useI18n()
|
||||
const toast = useToast()
|
||||
|
|
@ -312,6 +313,9 @@ const onSelect = (pickedVal: Picked | null) => {
|
|||
}
|
||||
|
||||
const saveRequestAs = async () => {
|
||||
const isValidToken = await handleTokenValidation()
|
||||
if (!isValidToken) return
|
||||
|
||||
if (!requestName.value) {
|
||||
toast.error(`${t("error.empty_req_name")}`)
|
||||
return
|
||||
|
|
|
|||
|
|
@ -270,6 +270,7 @@ import { RESTTabService } from "~/services/tab/rest"
|
|||
import { getMethodLabelColor } from "~/helpers/rest/labelColoring"
|
||||
import { WorkspaceService } from "~/services/workspace.service"
|
||||
import { KernelInterceptorService } from "~/services/kernel-interceptor.service"
|
||||
import { handleTokenValidation } from "~/helpers/handleTokenValidation";
|
||||
|
||||
const t = useI18n()
|
||||
const interceptorService = useService(KernelInterceptorService)
|
||||
|
|
@ -514,7 +515,10 @@ const cycleDownMethod = () => {
|
|||
}
|
||||
}
|
||||
|
||||
const saveRequest = () => {
|
||||
const saveRequest = async () => {
|
||||
const isValidToken = await handleTokenValidation()
|
||||
if (!isValidToken) return
|
||||
|
||||
const saveCtx = tab.value.document.saveContext
|
||||
|
||||
if (!saveCtx) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue