's'
This commit is contained in:
@@ -63,7 +63,7 @@ export default function JoinPage() {
|
|||||||
const checkAuth = useCallback(async () => {
|
const checkAuth = useCallback(async () => {
|
||||||
if (getStoredToken()) return true;
|
if (getStoredToken()) return true;
|
||||||
try {
|
try {
|
||||||
const res = await fetch("/api/auth/me");
|
const res = await fetch("/api/auth/me", { credentials: "include" });
|
||||||
const data = await res.json();
|
const data = await res.json();
|
||||||
return !!(data?.user && data?.token);
|
return !!(data?.user && data?.token);
|
||||||
} catch {
|
} catch {
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ export default function AuthModal({ isOpen, onClose, onSuccess }: AuthModalProps
|
|||||||
method: "POST",
|
method: "POST",
|
||||||
headers: { "Content-Type": "application/json" },
|
headers: { "Content-Type": "application/json" },
|
||||||
body: JSON.stringify({ token: result.token, record: result.record }),
|
body: JSON.stringify({ token: result.token, record: result.record }),
|
||||||
|
credentials: "include",
|
||||||
});
|
});
|
||||||
} catch {
|
} catch {
|
||||||
/* ignore */
|
/* ignore */
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ export default function Header() {
|
|||||||
let mounted = true;
|
let mounted = true;
|
||||||
(async () => {
|
(async () => {
|
||||||
try {
|
try {
|
||||||
const res = await fetch("/api/auth/me");
|
const res = await fetch("/api/auth/me", { credentials: "include" });
|
||||||
const data = await res.json();
|
const data = await res.json();
|
||||||
if (!mounted) return;
|
if (!mounted) return;
|
||||||
if (data?.user && data?.token) {
|
if (data?.user && data?.token) {
|
||||||
|
|||||||
Reference in New Issue
Block a user