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

Feat login id validation #733

Closed
wants to merge 8 commits into from

Conversation

Gopal-001
Copy link
Contributor

**My PR closes #716 **

πŸ‘¨β€πŸ’» Changes proposed(What did you do ?)

during the merging process the condition got refactored causing breaking of login part.
redo the condition.

  if (!id && (typeof id !== 'string' || !userIDPattern.test(id))) {

here if email login than id will be undefined so condition so we are checking if id is coming than moving fwd to verify the type and regex pattern, and if it's invalid we'll just move ahead.

βœ”οΈ Check List (Check all the applicable boxes)

  • My code follows the code style of this project.
  • This PR does not contain plagiarized content.
  • The title and description of the PR is clear and explains the approach.

Note to reviewers

πŸ“· Screenshots

NA

Copy link

vercel bot commented Nov 29, 2024

Someone is attempting to deploy a commit to the dunsin's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Compliance Checks

Thank you for your Pull Request! We have run several checks on this pull request in order to make sure it's suitable for merging into this project. The results are listed in the following section.

Conventional Commit PR Title

In order to be considered for merging, the pull request title must match the specification in conventional commits. You can edit the title in order for this check to pass.
Most often, our PR titles are something like one of these:

  • docs: correct typo in README
  • feat: implement dark mode"
  • fix: correct remove button behavior

Linting Errors

  • Found type "null", must be one of "feat","fix","docs","style","refactor","perf","test","build","ci","chore","revert"
  • No subject found

@Dun-sin
Copy link
Owner

Dun-sin commented Nov 29, 2024

@Gopal-001 think it fails because your solution wasn't reviewed properly by me, but not because of that code specifically.

but because you were trying to validate the ID, your code is wrong and my refactor was what was needed, you didn't test this in local, please do next time

but yeah will fix it on my end and push it, will share the commit if you would like to see the solution

@Dun-sin
Copy link
Owner

Dun-sin commented Nov 29, 2024

@Gopal-001 actually you were right, will fix it to match both cases and still not allow a pass

@Dun-sin Dun-sin closed this Nov 29, 2024
@Dun-sin
Copy link
Owner

Dun-sin commented Nov 29, 2024

@Gopal-001 had to revert to the old code in server, but kept the one in frontend. Thanks

@Gopal-001
Copy link
Contributor Author

@Gopal-001 think it fails because your solution wasn't reviewed properly by me, but not because of that code specifically.

but because you were trying to validate the ID, your code is wrong and my refactor was what was needed, you didn't test this in local, please do next time

but yeah will fix it on my end and push it, will share the commit if you would like to see the solution

@Dun-sin sure thanks for the feedback, although I've already teseted it but if you're looking into it.However pls refer to this commit 308b606 if in page server/utils/helper.js we just replace this condition back if(!id && (typeof id !== 'string' || !userIDPattern.test(id))) it will work properly.

@Dun-sin
Copy link
Owner

Dun-sin commented Nov 30, 2024

@Gopal-001 think it fails because your solution wasn't reviewed properly by me, but not because of that code specifically.

but because you were trying to validate the ID, your code is wrong and my refactor was what was needed, you didn't test this in local, please do next time

but yeah will fix it on my end and push it, will share the commit if you would like to see the solution

@Dun-sin sure thanks for the feedback, although I've already teseted it but if you're looking into it.However pls refer to this commit 308b606 if in page server/utils/helper.js we just replace this condition back if(!id && (typeof id !== 'string' || !userIDPattern.test(id))) it will work properly.

It works but it's not an ideal solution

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.

[FEATURE] FRONT-END: Validate loginId to be a valid uuid
2 participants