ragflow / web /src /hooks /authHook.ts
balibabu
feat: prevent the user from entering the knowledge base if he is not logged in (#45)
04aba1b
raw
history blame
248 Bytes
import authorizationUtil from '@/utils/authorizationUtil';
import { useState } from 'react';
export const useAuth = () => {
const [isLogin, setIsLogin] = useState(
() => !!authorizationUtil.getAuthorization(),
);
return { isLogin };
};