monkeytypegame / monkeytype

The most customizable typing website with a minimalistic design and a ton of features. Test yourself in various modes, track your progress and improve your speed.
https://monkeytype.com/
GNU General Public License v3.0
15.97k stars 2.42k forks source link

Validate input on name update #5934

Closed fehmer closed 1 month ago

fehmer commented 2 months ago

Use UserNameSchema to validate the new username on the frontend.

janardannn commented 2 months ago

can i attempt?? @fehmer

Miodec commented 1 month ago

Im assuming you mean validate the name before making a request?

fehmer commented 1 month ago

Im assuming you mean validate the name before making a request?

Yes. While typing or on form submit.

Miodec commented 1 month ago

@janardannn you can add this validation if you want.

m4dd0c commented 1 month ago

Could you specify rules for usernameSchema ? It would be a great help.

fehmer commented 1 month ago

The validation schema is already in place and should be used here as well: https://github.com/monkeytypegame/monkeytype/blob/master/packages/contracts/src/users.ts#L40-L47

m4dd0c commented 1 month ago

Oh, I see. I would like to work on this Please assign me.