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

Fix signup query #1608

Merged
merged 9 commits into from Jan 26, 2022
Merged

Fix signup query #1608

merged 9 commits into from Jan 26, 2022

Conversation

miguelnietoa
Copy link
Contributor

What does this PR do?

This PR modifies the query to check if there is an existing user, removing the condition that the email must be verified and adding ones that check if both password and username are set. The condition of email verified is not necessary because even if the email is not verified the user exists and has access to create event types, bookings, teams, etc.

Some tests were also added.

Fixes #1432

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How should this be tested?

  • Go to a team page (/settings/teams)
  • Invite a new user (without an account yet)
  • Click the link on the invite email or if running locally: visit directly the URL /auth/signun?token={token}. The token can be found in the VerificationRequest table.
  • Try to signup with an unavailable username
  • The error message should be Username already taken

image

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code and corrected any misspellings
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@vercel
Copy link

vercel bot commented Jan 24, 2022

@miguelnietoa is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

@zomars zomars self-requested a review January 25, 2022 16:47
@zomars zomars self-assigned this Jan 25, 2022
@zomars zomars requested a review from jamiepine January 25, 2022 16:58
@zomars zomars added ❌ merge conflicts ♻️ autoupdate tells kodiak to keep this branch up-to-date labels Jan 25, 2022
Copy link
Member

@zomars zomars left a comment

Choose a reason for hiding this comment

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

Nice work! Everything looks fine from my side. I'm tagging @jamiepine since he's working in a team settings refactor.

@vercel
Copy link

vercel bot commented Jan 25, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/cal/calendso/8rvMAkEgqqKoGb6yUXZJs4PBCX9V
✅ Preview: https://calendso-git-fork-kommitters-fix-signup-query-cal.vercel.app

@vercel vercel bot temporarily deployed to Preview January 25, 2022 17:01 Inactive
@miguelnietoa
Copy link
Contributor Author

Nice work! Everything looks fine from my side. I'm tagging @jamiepine since he's working in a team settings refactor.

All right @zomars , thanks. 💯

@zomars
Copy link
Member

zomars commented Jan 25, 2022

BTW @miguelnietoa there are some conflicts with main that must be resolved first. Also there is one test failing. If we could check those out before merging that would be awesome. 🙏🏽

@miguelnietoa
Copy link
Contributor Author

miguelnietoa commented Jan 25, 2022

BTW @miguelnietoa there are some conflicts with main that must be resolved first. Also there is one test failing. If we could check those out before merging that would be awesome. 🙏🏽

Both required changes are done! 👍🏻 @zomars
I just had to delete from the database all the data created for the tests I did because the Button with data-testid="new-event-type" is only shown when the user has no teams, that's why the test playwright/event-types.test.ts failed.
But now all works well.

Best.

@vercel vercel bot temporarily deployed to Preview January 26, 2022 15:39 Inactive
@vercel vercel bot temporarily deployed to Preview January 26, 2022 16:43 Inactive
@zomars
Copy link
Member

zomars commented Jan 26, 2022

Thank you for your contribution! I'll merge once all checks passes.

@zomars zomars enabled auto-merge (squash) January 26, 2022 16:46
@zomars
Copy link
Member

zomars commented Jan 26, 2022

@miguelnietoa we just need to update the branch to main and we're good to go! 👍🏽

@vercel vercel bot temporarily deployed to Preview January 26, 2022 16:52 Inactive
@zomars zomars merged commit 73de0c2 into calcom:main Jan 26, 2022
@miguelnietoa
Copy link
Contributor Author

Thanks @zomars 🚀

@juanhurtado10 juanhurtado10 deleted the fix/signup-query branch January 26, 2022 21:18
buschco pushed a commit to buschco/calendso that referenced this pull request Mar 27, 2022
* Remove emailVerified not null from query

* Improve query to find existing user

* Add test suite to Signup from a Team Invite

* Allow importing modules with aliases

* Delete created data after all tests

* Resolve conflicts

* Use teampro instead of pro user and refactor code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
♻️ autoupdate tells kodiak to keep this branch up-to-date
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Signup fails when inviting a new user to a team and username is not available
2 participants