ai-stories-factory / src /lib /oauth /useShouldDisplayLoginWall.ts
jbilcke-hf's picture
jbilcke-hf HF staff
emergency fix
3420ebd
raw
history blame
537 Bytes
import { useDynamicConfig } from "../config/useDynamicConfig"
export function useShouldDisplayLoginWall() {
const { config, isConfigReady } = useDynamicConfig()
const clientId = config.oauthClientId
const enableOAuth = config.enableHuggingFaceOAuth
const enableOAuthWall = config.enableHuggingFaceOAuthWall
const isConfigEnablingOAuthWall = Boolean(
clientId &&
enableOAuth &&
enableOAuthWall
)
const shouldDisplayLoginWall =
isConfigReady &&
isConfigEnablingOAuthWall
return shouldDisplayLoginWall
}