SignUp handleSubmit skipValidation parameter not exposed in TypeScript types

オープン 初心者向け
#485 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
76/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
react, typescript

調査の方向性

BaseSignUpRenderProps の TypeScript 定義と、対応する BaseSignIn の render-props 型を検索します。それらの handleSubmit 宣言を、issue に記載された実行時シグネチャと比較し、両方の宣言を更新してオプションの skipValidation パラメーターを公開します。その後、関連する型チェックまたはテストを実行して、consumer が 3 番目の引数を渡せることを確認します。

索引モデルが issue の本文から書いたものです。

説明

Description

The handleSubmit function in the v2 SignUp/SignIn embedded flow components accepts a skipValidation third parameter, but this parameter is not exposed in the TypeScript type definitions. This makes it impossible for consumers using the render props pattern to skip validation for specific actions (e.g., social login triggers that don't need form inputs).

Current Behavior

The runtime function signature supports skipValidation:

// From compiled dist/index.js (~line 11844)
const handleSubmit = async (component, data, skipValidation) => {
    if (!skipValidation) {
      touchAllFields();
      const validation = validateForm();
      if (!validation.isValid) {
        return;
      }
    }
    // ... proceed with API call
};

But the TypeScript type in BaseSignUpRenderProps only declares:

handleSubmit: (component: any, data?: Record<string, any>) => Promise<void>;

The third parameter is missing from the type, so TypeScript consumers don't know it exists and can't use it without any casting.

Expected Behavior

The type should expose the skipValidation parameter:

handleSubmit: (component: any, data?: Record<string, any>, skipValidation?: boolean) => Promise<void>;

This allows consumers to decide when validation should be skipped based on their own logic. For example, in Thunder's gate, social login trigger buttons skip validation since they don't use form inputs:

onSubmit={(action, inputs) => {
    const isTrigger = action.eventType === EmbeddedFlowEventType.Trigger;
    void handleSubmit(action, inputs, isTrigger);
}}

Affected Components

  • v2 SignUp (BaseSignUp)BaseSignUpRenderProps.handleSubmit type definition
  • v2 SignIn (BaseSignIn) — equivalent render props type definition

Both have the skipValidation parameter in the runtime implementation but not in the types.

Related

Additional Context

  • SDK version: @asgardeo/react@0.23.1
  • The validation-skipping logic should remain a consumer decision, not an SDK-internal assumption — there are valid cases where trigger actions may still need form validation
主要言語
TypeScript
スター
18
フォーク
67
平均マージ
4時間 6分
マージ済み PR(30日)
13

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

asgardeo/javascript のほかの issue

asgardeo/javascript の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。