Skip to content

Implement form filling - #5989

Open
tung2744 wants to merge 36 commits into
authgear:mainfrom
tung2744:dev-3905-form-impl
Open

tung2744 wants to merge 36 commits into
authgear:mainfrom
tung2744:dev-3905-form-impl

Conversation

@tung2744

@tung2744 tung2744 commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

ref DEV-3905


What you can test:

  1. The new fill_form step:
authentication_flow:
  # In signup flow
  signup_flows:
    - name: default
      steps:
        # ... other steps
        - type: fill_form
          form:
            name: names
            fields:
              - user_profile:
                  pointer: /given_name
                  required: true
              - user_profile:
                  pointer: /family_name
                  required: true

  # In login flow
  login_flows:
    - name: default
      steps:
        # ... other steps
        - type: fill_form
          form:
            name: names
            fields:
              - user_profile:
                  pointer: /given_name
                  required: true
              - user_profile:
                  pointer: /family_name
                  required: true
  1. form in identify step:
authentication_flow:
  # In signup flow
  signup_flows:
    - name: default
      steps:
        - name: firstiden
          one_of:
            - identification: email
              form:
                name: emailform
                fields:
                  - user_profile:
                      pointer: /given_name
                      required: true

Also test it in signup login flow:

ui:
  signup_login_flow_enabled: true

UI of different type of inputs:

Screenshot 2026-10-13 at 3 37 32 PM Screenshot 2026-10-13 at 3 37 20 PM

The commit 951e94d added classnames to each form, this is for the form builder we are going to add in portal.

Specify forms that collect user profile attributes in authentication
flows: the fill_form step for custom flows, user_profile.forms for the
default flows, field validation, the user.profile.pre_update hook
reasons, and the Authflow API.

Also add the boolean custom attribute type and string constraints to
the user profile spec, and fix stale step names in related specs.

ref DEV-3873
user.profile.pre_update fired on form submission, but a flow stores
the filled attributes only when it finishes. Add a blocking event for
form submission, fire user.pre_create or user.profile.pre_update when
the flow finishes, and move per-field reasons to the new event.
Address design review comments on the profile filling spec:

- Remove user_profile.forms. Forms are available only in flows defined
  in authentication_flow.
- Remove the form key show. A form is shown every time the flow reaches
  it; showing a form only when an attribute is missing is future work.
- Add form to the email, phone, and username branches of the identify
  step in signup and promote flows, to collect attributes on the same
  page as the login ID.
- Nest the form name and fields under form in the
  authentication.form.post_submitted payload and in fill_form_data.

ref DEV-3873
Also keep triggered_by admin_api for portal profile updates, and add
standard-attribute-label-{pointer} for standard attribute labels.
A config key that was never supported is not expected to exist, so
rejecting it or giving it a meaning does not break a deployment. This
removes the entry for the form and string-constraint keys.

ref DEV-3905
Generated with make -C scripts/python generate-translations for the
standard attribute labels, string constraint hints and errors, and boolean
values.
Generated with make -C scripts/python generate-translations.
…ssing

When a required field is missing and other fields are submitted, the validator
reports the key and value of every submitted field instead of a single cause at
/fields. The filled fields got "invalid value" and the missing one got nothing.

Fold those causes into one cause at /fields, and flag an unchecked required
checkbox for both cause shapes.
URLSearchParams.set keeps only the last value of a repeated name, so the hidden
false after a checkbox replaced its true. Use append so the server receives
both and reads the first.
- Start-align labels, hints and errors, which followed the project's content
  alignment, and add spacing around the fields on fill_form and signup.
- Show text-like fields of the signup identify form as placeholders, like the
  login ID input.
- Use the select input for fields with suggestions, such as gender, and show
  "Country" as the address country placeholder.
- Show the error state on selects, dates, address inputs and checkboxes.
Move the missing required rule into isMissingRequired to satisfy gocognit.
Wrap the fields of a form in .form__container, a grid with the default
single-column layout, and add .form__container--<name> for a named form.
The modifier has no styles, so custom CSS can set the grid template and gaps.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants