mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-13 08:06:24 +08:00
fix(admin): unable to log into admin panel (#11451)
This commit is contained in:
@@ -7,6 +7,7 @@ import { useCallback, useRef } from 'react';
|
||||
import { Navigate } from 'react-router-dom';
|
||||
import { toast } from 'sonner';
|
||||
|
||||
import { affineFetch } from '../../fetch-utils';
|
||||
import { isAdmin, useCurrentUser, useRevalidateCurrentUser } from '../common';
|
||||
import logo from './logo.svg';
|
||||
|
||||
@@ -20,7 +21,7 @@ export function Auth() {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
if (!emailRef.current || !passwordRef.current) return;
|
||||
fetch('/api/auth/sign-in', {
|
||||
affineFetch('/api/auth/sign-in', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({
|
||||
email: emailRef.current?.value,
|
||||
@@ -38,7 +39,7 @@ export function Auth() {
|
||||
return response.json();
|
||||
})
|
||||
.then(() =>
|
||||
fetch('/graphql', {
|
||||
affineFetch('/graphql', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({
|
||||
operationName: getUserFeaturesQuery.op,
|
||||
|
||||
Reference in New Issue
Block a user