mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-19 07:17:00 +08:00
fix(admin): unable to log into admin panel (#11451)
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user