You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there, I follow this project since you are one of the very few people that uses typed. Browsing your code I noticed a function called ensureCredentials which uses credentialsType to validate email and password. Since I use typed to do the same thing on my own projects, I created two extra add-ons to deal with emails and passwords that may worth you checking them out. typed-email uses RFC822 compliant regex to validate emails. It also trims and lowercase them before validation. typed-password enforces a set of rules that a password must pass to be considered valid (useful for account creation). Anyways, here is an example:
import*asTfrom'typed'import*asPfrom'typed-password'import{email}from'typed-email'constpassword=P.password(P.nospace,// don't allow whitespacesP.min(8),// at least 8 charactersP.max(20),// at most 20 charactersP.upper(),// at least 1 uppercase letterP.lower(),// at least 1 lowercase letterP.digit(),// at least 1 digitP.symbol()// at least 1 special character)constcredentialsType=T.object({
email,
password,})
Hope you find them useful.
The text was updated successfully, but these errors were encountered:
I'm not sure I agree with the restrictions you're setting.
For example, I myself prefer to use whitespace and multi-word senseless passwords like r0ck p@rrot dieSel, which are easy to remember, but relatively hard to guess.
I'm against hard restrictions on the password, as they are not only annoying but limit the number of possible variations, making it easier to guess.
Instead, I was going for the visual aid for the password field, which would rank a password from weak to strong and let the user decide if the security level is appropriate.
I'll leave the issue up for future development though, thank you for bringing it up!
Hi there, I follow this project since you are one of the very few people that uses
typed
. Browsing your code I noticed a function calledensureCredentials
which usescredentialsType
to validate email and password. Since I usetyped
to do the same thing on my own projects, I created two extra add-ons to deal with emails and passwords that may worth you checking them out. typed-email uses RFC822 compliant regex to validate emails. It also trims and lowercase them before validation. typed-password enforces a set of rules that a password must pass to be considered valid (useful for account creation). Anyways, here is an example:Hope you find them useful.
The text was updated successfully, but these errors were encountered: