/
alt3rmann
/
LibreChat
Обзор
Документация
Войти
/
alt3rmann
/
LibreChat
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
client/src/hooks/Input/useRequiresKey.ts
19 строк
688 B
Danny Avila
🛂 feat: OpenID Logout Redirect to `end_session_endpoint` (#5626)
03 фев 2025, 18:53
Не верифицирован
03 фев 2025, 18:53
45dd2b2
Код
Авторство
О чём код?
import { useChatContext } from '~/Providers/ChatContext'; import { useGetEndpointsQuery } from '~/data-provider'; import { getEndpointField } from '~/utils'; import useUserKey from './useUserKey'; export default function useRequiresKey() { const { conversation } = useChatContext(); const { data: endpointsConfig } = useGetEndpointsQuery(); const { endpoint } = conversation || {}; const userProvidesKey: boolean | null | undefined = getEndpointField( endpointsConfig, endpoint, 'userProvide', ); const { getExpiry } = useUserKey(endpoint ?? ''); const expiryTime = getExpiry(); const requiresKey = !expiryTime && userProvidesKey; return { requiresKey }; }