github / github/accessibility-scanner
Support configurable login form selectors for non-standard label names
- Dominant language
- TypeScript
- Stars
- 369
- Forks
- 40
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 10
Description
## Problem
The auth action finds login fields using `getByLabel(/user ?name/i)` and `getByLabel(/password/i)`. This misses common login forms:
- **Email-based login**: "Email", "E-Mail" don't match `/user ?name/i`
- **Non-English apps**: "Benutzername", "Mot de passe" don't match
- **No visible labels**: Forms using only `placeholder` attributes
When no match is found, the login form is not detected and the scanner proceeds unauthenticated.
## Suggested fix
1. **Fall back to input types** when label matching fails: `input[type="password"]` for the password field, and the closest preceding `input[type="text"]` or `input[type="email"]` for the username field.
2. **Make selectors configurable** via optional inputs like `username_selector` and `password_selector`, so users can specify their own labels, placeholders, or CSS selectors for non-standard forms.
Contributor guide
Research direction
Start at the auth action where getByLabel(/user ?name/i) and getByLabel(/password/i) locate login fields, then inspect how optional inputs are defined. Support configurable username_selector and password_selector values plus the proposed input-type fallbacks, and verify that non-standard or label-free forms are detected and scanned authenticated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- accessibility, authentication
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100