mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-03-07 16:42:38 +01:00
🔗 fix: Shared Link with Markdown Code Error (#6016)
* refactor: Export AuthContext from AuthContextProvider * refactor: Update useHasAccess to utilize useContext for AuthContext * refactor: Enhance type definitions in useHasAccess for better type safety
This commit is contained in:
parent
50e8769340
commit
f362f18870
2 changed files with 24 additions and 9 deletions
|
|
@ -8,7 +8,7 @@ import {
|
|||
createContext,
|
||||
} from 'react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { useRecoilState, useRecoilValue } from 'recoil';
|
||||
import { useRecoilState } from 'recoil';
|
||||
import { setTokenHeader, SystemRoles } from 'librechat-data-provider';
|
||||
import type * as t from 'librechat-data-provider';
|
||||
import {
|
||||
|
|
@ -200,7 +200,7 @@ const AuthContextProvider = ({
|
|||
},
|
||||
isAuthenticated,
|
||||
}),
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
|
||||
[user, error, isAuthenticated, token, userRole, adminRole],
|
||||
);
|
||||
|
||||
|
|
@ -217,4 +217,4 @@ const useAuthContext = () => {
|
|||
return context;
|
||||
};
|
||||
|
||||
export { AuthContextProvider, useAuthContext };
|
||||
export { AuthContextProvider, useAuthContext, AuthContext };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue