pankod/refine

View on GitHub
packages/core/src/hooks/auth/useIsExistAuthentication/index.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { useAuthBindingsContext, useLegacyAuthContext } from "@contexts/auth";

/**
 * A hook that the UI uses
 * @internal
 */
export const useIsExistAuthentication = (): boolean => {
  const { isProvided: legacyIsProvided } = useLegacyAuthContext();
  const { isProvided } = useAuthBindingsContext();

  return Boolean(isProvided || legacyIsProvided);
};