/** * @license * Copyright Stbui All Rights Reserved. * https://github.com/stbui/prophet */ declare type CheckAuth = (params?: any, logoutOnFailure?: boolean, redirectTo?: string, disableNotification?: boolean) => Promise; /** * * @example * * import { useEffect,useState } from 'react'; * import { useCheckAuth } from '@stbui/prophet-core'; * * const Page = () => { * const checkAuth = useCheckAuth(); * useEffect(() => { * checkAuth().catch(() => {}); * }, []); * * return
ok
; * }; * * const MyApp = () => { * const checkAuth = useCheckAuth(); * const [authenticated, setAuthenticated] = useState(true); * useEffect(() => { * checkAuth({}, false).then() => setAuthenticated(true)).catch(() => setAuthenticated(false)); * }, []); * * return authenticated ?
ok
:
fail
; * }; */ declare const useCheckAuth: () => CheckAuth; export default useCheckAuth;