-
Notifications
You must be signed in to change notification settings - Fork 636
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
fix: allow handle format with tld shorter than 3 characters #3619
fix: allow handle format with tld shorter than 3 characters #3619
Conversation
message: 'Handle must be at least 3 characters long', | ||
}) | ||
.refine((value) => value.split('.')[0].length <= 18, { | ||
message: 'Handle must be at most 18 characters long', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution. This looks almost right 👍 |
would it be clearer to validate the overall handle syntax using the |
I agree! Just need to figure out how to properly get it all running locally and wrap my head around the codebase and packages 😄 |
When trying to sign up in the oAuth flow with a tld or domain shorter than 3 char, you end up getting blocked by zod validation against the post body.
Example of failing ones:
"hello.norwegian.no"
"hello.vg.com"
One could in theory move the logic from
ensureHandleServiceConstraints
https://github.com/Johannes-Andersen/atproto/blob/main/packages/pds/src/handle/index.ts#L26 to align the logic. But not familiar enough with the codebase to know how that would be done.Logic can also be tested on https://zod-playground.vercel.app/
Ref implementation done by @matthieusieben in #2945
--


Error:
Stack from logs: