This file holds a few of my suggestions for the SuperTokens team. These suggestions primarily revolve around the frontend, which I am more familiar with.
- Provide proper
label
s for all of the HTMLinput
s instead of usingdiv
s.- This will clarify the purpose of each input to people who need more accessibility (a11y) help.
- Change the
Sign In
/Sign Up
"link-like text" to be a regular link (ana
tag).- This will ensure that people who aren't using JavaScript can easily access both the
Sign In
page and theSign Up
page. It also guarantees keyboard accessibility for the element.
- This will ensure that people who aren't using JavaScript can easily access both the
- Change the
Forgot Password
button from adiv
to a normal link (ana
tag).- This will ensure that people who aren't using JavaScript can still access the page for resetting passwords easily. It will also ensure that users who rely on keyboards (instead of a mouse) can access this page.
- Add
:focus
styles for allbutton
s. You can probably copy whatever the:hover
styles are for this.- This is something that will help visual users who are relying on their keyboard. Currently, there is no visual indicator that the
button
s are being focused when navigating with a keyboard.
- This is something that will help visual users who are relying on their keyboard. Currently, there is no visual indicator that the
- Add proper ARIA attributes to the auth forms for better a11y. (For instance, use
aria-errormessage
oraria-describedby
for any error messages related to inputs.) "field is not optional"
can end up being an ambiguous message for users when screen readers announce said message. Perhaps using the field name (e.g.,email
orpassword
) instead of the literal wordfield
for these messages could be more helpful.
Note: Even if the solutions that SuperTokens currently provides are dependent on JavaScript, it will still be useful to minimize the amount of JavaScript necessary on the frontend as much as possible. That way, when/if a JavaScript-free solution is crafted, it will be much easier to perform the necessary migrations.
If possible, it would be great for the SuperTokens endpoints to support regular HTML form
POSTS. This would guarantee that applications could work easily without JavaScript, and it would pave the way for some of the JS-free suggestions I mentioned previously. (The suggestions I gave still have value regardless because of a11y.)