Skip to content

Commit

Permalink
fix: subjkt field validation and capitalization
Browse files Browse the repository at this point in the history
Co-authored-by: Mel Massadian <[email protected]>

- Closes #303
- Closes #336
  • Loading branch information
Zir0h authored Oct 27, 2023
1 parent 3dce473 commit 89af49d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/pages/config/Subjkt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,13 @@ export const Subjkt = () => {
value={subjkt}
onChange={setSubjkt}
onBlur={(e) => {
setSubjkt(e.target.value.replace(/[^a-z0-9-._]/g, ''))
if(/[^A-Za-z0-9-._]/.test(e.target.value)) {
show('Subjkt contains invalid characters. This field can only contain: letters (a-z A-Z), numbers (0-9), . (dot), - (dash), _ (underscore)')
}
}}
placeholder="can contain letters (a-z), numbers (0-9), . (dot), - (dash), _ (underscore)"
placeholder="can contain letters (a-z A-Z), numbers (0-9), . (dot), - (dash), _ (underscore)"
label="Username"
pattern="^[a-z0-9-._]*$"
pattern="^[A-Za-z0-9-._]*$"
/>
<Input
name="description"
Expand Down

0 comments on commit 89af49d

Please sign in to comment.