mirror of
https://github.com/RuoJi6/ARTEX.git
synced 2026-12-06 21:11:50 +08:00
fix: recover expired Basic Auth sessions in the current tab
This commit is contained in:
1 parent
a05a886d3d
commit
0ff2130f46
7 files changed
+275
-20
No files matched your search
@@ -7,6 +7,7 @@ import { RotateCcwIcon, ZoomInIcon, ZoomOutIcon } from "lucide-react";
|
||||
|
||||
import { Dialog, DialogContent } from "@/components/ui/dialog";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { apiFetch } from "@/lib/api";
|
||||
import { auth } from "@/lib/auth";
|
||||
|
||||
function AuthenticatedImage({
|
||||
@@ -39,7 +40,7 @@ function AuthenticatedImage({
|
||||
|
||||
const token = auth.getToken();
|
||||
setCaptureTimestamp(null);
|
||||
fetch(imageSrc, {
|
||||
apiFetch(imageSrc, {
|
||||
credentials: "same-origin",
|
||||
headers: token ? { Authorization: `Bearer ${token}` } : undefined,
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user