Skip to content

Commit

Permalink
chore: add jsdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
thisyahlen-deriv committed Sep 18, 2024
1 parent b511b8b commit b7a0e80
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/hooks/useIsOAuth2Enabled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useOAuth2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void>} WSLogoutAndRedirect - Function to handle logout and redirection.
* @returns {{ OAuth2Logout: () => Promise<void> }} - Object containing the OAuth2Logout function.
*/
Expand Down

0 comments on commit b7a0e80

Please sign in to comment.