From b7a0e8076de6b4b8121ebb41a0cc489c19d6a76f Mon Sep 17 00:00:00 2001 From: Thisyahlen Date: Wed, 18 Sep 2024 11:57:36 +0800 Subject: [PATCH] chore: add jsdoc --- src/hooks/useIsOAuth2Enabled.ts | 6 ++++++ src/hooks/useOAuth2.ts | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/hooks/useIsOAuth2Enabled.ts b/src/hooks/useIsOAuth2Enabled.ts index 2d4e92c..ff44d6a 100644 --- a/src/hooks/useIsOAuth2Enabled.ts +++ b/src/hooks/useIsOAuth2Enabled.ts @@ -5,6 +5,12 @@ type hydraBEApps = { enabled_for: number[]; }; +/** + * Custom hook to determine whether OAuth2 is enabled for a given app id. + * @param {hydraBEApps[]} OAuth2EnabledApps - an array of Hydra enabled apps + * @param {boolean} OAuth2EnabledAppsInitialised - a flag indicating whether the array has been initialised + * @returns {boolean} - a boolean indicating whether OAuth2 is enabled for the current app id + */ export const useIsOAuth2Enabled = ( OAuth2EnabledApps: hydraBEApps[], OAuth2EnabledAppsInitialised: boolean diff --git a/src/hooks/useOAuth2.ts b/src/hooks/useOAuth2.ts index 9c73735..9374721 100644 --- a/src/hooks/useOAuth2.ts +++ b/src/hooks/useOAuth2.ts @@ -19,7 +19,7 @@ type OAuth2Config = { /** * Custom hook to handle OAuth2 logout and redirection. * - * @param {OAuth2Config} config - Configuration object containing OAuth2 enabled apps and initialisation flag. + * @param {OAuth2Config} config - Configuration object containing OAuth2 enabled apps flag and initialisation flag. * @param {(oauthUrl: string) => Promise} WSLogoutAndRedirect - Function to handle logout and redirection. * @returns {{ OAuth2Logout: () => Promise }} - Object containing the OAuth2Logout function. */