CDP Frontend SDK
    Preparing search index...

    Function useOAuthState

    • Hook to access the current OAuth flow state. This can be used to track the status of an ongoing OAuth authentication flow.

      Returns { oauthState: null | OAuthFlowState }

      The current OAuth flow state

      function OAuthStatus() {
      const { oauthState } = useOAuthState();

      if (!oauthState) {
      return null;
      }

      return (
      <div>
      <p>OAuth Status: {oauthState.status}</p>
      {oauthState.status === "error" && (
      <p>Error: {oauthState.errorDescription}</p>
      )}
      </div>
      );
      }