Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Make Valid Handle Function for Custom Domain Handles #5351

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

RetroSunstar
Copy link

Prevents the user from putting invalid domain characters in the Change Handle field for Custom Domains, mentioned in #1528

Hopefully this is okay? 🩵🩷🩵🩷

@mary-ext
Copy link
Contributor

mary-ext commented Sep 16, 2024

why not check if the handle is actually valid rather than stripping invalid characters?
/[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*(?:\.[a-zA-Z]{2,})/

@RetroSunstar
Copy link
Author

why not check if the handle is actually valid rather than stripping invalid characters?

Simply because that's how Bluesky handles it for .bsky.social handles, with the makeValidHandle function just above in handles.ts

I just put some characters that couldn't be used in a domain to begin with, esspecially the @ symbol as that's the subject of the original issue

Anything else I assume would be handled when the user goes to verify the DNS record or Text file? As the domain simply wouldn't exist

Alternatively, there's allowing the user to input these characters but show an error as soon as one is, which might affect typing less and allow the user to simply go back and change it? 🩵🩷🩵🩷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants