Skip to content

Adds an entry for mixed login-registration forms.#18

Open
blackwood wants to merge 3 commits into
mainfrom
PM-36091
Open

Adds an entry for mixed login-registration forms.#18
blackwood wants to merge 3 commits into
mainfrom
PM-36091

Conversation

@blackwood

@blackwood blackwood commented May 18, 2026

Copy link
Copy Markdown
Contributor

🎟️ Tracking

PM-36091

@blackwood blackwood requested a review from a team as a code owner May 18, 2026 15:26
@blackwood blackwood requested a review from jprusik May 18, 2026 15:26
@jprusik

jprusik commented May 20, 2026

Copy link
Copy Markdown
Collaborator

Merge conflict needs resolution

@jprusik jprusik left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything is pointed at the correct (exclusive) fields. I've made some suggestions to silence the warnings and the email field needs to be split from the username field (see specific notes). Feel free to ping me if you'd like to discuss it more offline.

Comment thread maps/forms/forms.jsonc
"forms": [
{
"category": "account-creation",
"container": ["#registerform-virtual"],

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"container": ["#registerform-virtual"],
"container": ["form#registerform-virtual"],

Comment thread maps/forms/forms.jsonc
"category": "account-creation",
"container": ["#registerform-virtual"],
"fields": {
"birthdateDay": ["#gamespot-bday-day"],

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"birthdateDay": ["#gamespot-bday-day"],
"birthdateDay": ["select#gamespot-bday-day"],

Comment thread maps/forms/forms.jsonc
"container": ["#registerform-virtual"],
"fields": {
"birthdateDay": ["#gamespot-bday-day"],
"birthdateMonth": ["#gamespot-bday-month"],

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"birthdateMonth": ["#gamespot-bday-month"],
"birthdateDay": ["select#gamespot-bday-month"],

Comment thread maps/forms/forms.jsonc
"fields": {
"birthdateDay": ["#gamespot-bday-day"],
"birthdateMonth": ["#gamespot-bday-month"],
"birthdateYear": ["#gamespot-bday-year"],

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"birthdateYear": ["#gamespot-bday-year"],
"birthdateDay": ["select#gamespot-bday-year"],

Comment thread maps/forms/forms.jsonc
"username": ["#user_email_register", "#user_reg_register"]
},
"actions": {
"submit": ["#wp-submit-register"]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"submit": ["#wp-submit-register"]
"submit": ["input#wp-submit-register[type='submit']"]

Comment thread maps/forms/forms.jsonc
},
{
"category": "account-login",
"container": ["#loginform-virtual"],

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"container": ["#loginform-virtual"],
"container": ["form#loginform-virtual"],

Comment thread maps/forms/forms.jsonc
"category": "account-login",
"container": ["#loginform-virtual"],
"fields": {
"password": ["#user_pass"],

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"password": ["#user_pass"],
"password": ["input#user_pass"],

Comment thread maps/forms/forms.jsonc
"container": ["#loginform-virtual"],
"fields": {
"password": ["#user_pass"],
"username": ["#user_login"]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"username": ["#user_login"]
"username": ["input#user_login"],

Comment thread maps/forms/forms.jsonc
"username": ["#user_login"]
},
"actions": {
"submit": ["#wp-submit"]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"submit": ["#wp-submit"]
"submit": ["input#wp-submit[type='submit']"]

Comment thread maps/forms/forms.jsonc
"birthdateDay": ["#gamespot-bday-day"],
"birthdateMonth": ["#gamespot-bday-month"],
"birthdateYear": ["#gamespot-bday-year"],
"username": ["#user_email_register", "#user_reg_register"]

@jprusik jprusik May 21, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hrm, this is an tricky case (bear with me while I think through it):

Both can be used interchangeably for login, but also both are required. They are both "usernames" for auth concerns, but distinct values (they don't represent the same value to be entered, so they should not be represented in a shared field selector array).

Our doc guidance on Field Keys says (emphasis mine):

Field keys are constrained to the following set. Keys are grouped here for readability; the groupings carry no semantic meaning in the schema.

That is, while email is grouped under the "Contact" heading in the README, it can represent any relevant contextual concern. And even though our consumer (the Bitwarden client) treats emails as a kind of username (an association bourne out of usage), this project map does not.

Similarly, a username doesn't have to represent an auth concern; it could simply be a handle (Valve's Steam platform has this concept- you have an account username which is public-facing, but it is not the username you log in with).

For now, I think #user_email_register should be an email field; consumers should be expected to check on the form category (e.g. account-login) to understand the relevant usage context for the field.

We should probably clarify in the forms README that the username key is meant exclusively for identifiers/handles not otherwise described by other keys (for example, I'm also thinking about forms which allow registration and login via phone number, which would still be described by a phone field). Additionally, none of this is really clear with the current field groupings, and they serve only to muddy the waters. I'll work on getting some doc clarifications up around these scenarios.

Suggested change
"username": ["#user_email_register", "#user_reg_register"]
"username": ["input#user_reg_register"],
"email": ["input#user_email_register"],

@jprusik jprusik May 22, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fwiw, I gave @dan-livefront conflicting guidance here, so you were consistent with prior art in this PR.

I still think this latest thinking is the right approach, though it may affect our consuming implementation

I've put up the updated guidance in the README in #19

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