mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
feat: prevent the user from entering the knowledge base if he is not logged in (#45)
This commit is contained in:
10
web/src/hooks/authHook.ts
Normal file
10
web/src/hooks/authHook.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import authorizationUtil from '@/utils/authorizationUtil';
|
||||
import { useState } from 'react';
|
||||
|
||||
export const useAuth = () => {
|
||||
const [isLogin, setIsLogin] = useState(
|
||||
() => !!authorizationUtil.getAuthorization(),
|
||||
);
|
||||
|
||||
return { isLogin };
|
||||
};
|
||||
Reference in New Issue
Block a user