fix(admin): unable to log into admin panel (#11451)

This commit is contained in:
JimmFly
2025-04-04 10:39:20 +00:00
parent eed26b1601
commit 3ecdc377fe
4 changed files with 32 additions and 4 deletions

View File

@@ -18,6 +18,7 @@ import { CircleUser } from 'lucide-react';
import { useCallback } from 'react';
import { toast } from 'sonner';
import { affineFetch } from '../../fetch-utils';
import { useCurrentUser, useRevalidateCurrentUser } from '../common';
interface UserDropdownProps {
@@ -63,7 +64,7 @@ export function UserDropdown({ isCollapsed }: UserDropdownProps) {
const relative = useRevalidateCurrentUser();
const handleLogout = useCallback(() => {
fetch('/api/auth/sign-out')
affineFetch('/api/auth/sign-out')
.then(() => {
toast.success('Logged out successfully');
return relative();