🔗 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:
Danny Avila 2025-02-24 22:52:54 -05:00 committed by GitHub
parent 50e8769340
commit f362f18870
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 24 additions and 9 deletions

View file

@ -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 };