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: disallow sign up with duplicate domain [ref: #517] #650

Merged
merged 4 commits into from
Sep 1, 2023

Conversation

HardeepAsrani
Copy link
Member

@HardeepAsrani HardeepAsrani commented Aug 26, 2023

All Submissions:

Changes proposed in this Pull Request:

Needs & Details at: https://github.com/Codeinwp/optimole-service/pull/1050

Closes https://github.com/Codeinwp/optimole-service/issues/517.

How to test the changes in this Pull Request:

  1. Once both Dashboard & WP are available for testing, create a new account from a website with some email. It should work fine.
  2. Once that is done, try to disconnect and sign up from the same site using a new email, it should notify you that the website has already been used with Optimole.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@pirate-bot
Copy link
Collaborator

pirate-bot commented Aug 26, 2023

Plugin build for f92034d is ready 🛎️!

@HardeepAsrani HardeepAsrani changed the base branch from development to next August 26, 2023 01:00
@HardeepAsrani HardeepAsrani requested a review from abaicus August 26, 2023 01:04
inc/rest.php Outdated
return new WP_REST_Response(
[
'data' => null,
'message' => sprintf( __( 'Error: This site has been previously registered. You can try again %1$shere%2$s ', 'optimole-wp' ), '<a href="https://dashboard.optimole.com/register" target="_blank"> ', '</a>' ),
Copy link
Contributor

Choose a reason for hiding this comment

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

@HardeepAsrani, what's the advantage of redirecting to the register page?

Copy link
Member Author

Choose a reason for hiding this comment

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

Followed the same notice pattern for the notice if the user is already registered. In case you want to try to log in as there is no other way to log in using a username/password from the plugin.

Copy link
Contributor

Choose a reason for hiding this comment

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

@HardeepAsrani my point is more if we don't allow people to register with the same domain, what's the point of redirecting them to the register page?

Copy link
Member Author

Choose a reason for hiding this comment

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

@selul Got it. I'll replace it with the login link and modify the message accordingly.

@irinelenache
Copy link

@HardeepAsrani Tested and it works fine when trying to create a new account using the wp plugin. I still can use a different account by manually creating it on the dashboard and connecting the website with the API key, is this expected?

@HardeepAsrani
Copy link
Member Author

@irinelenache Yes, that's expected. Should I move it to Ready to Merge?

@abaicus
Copy link
Contributor

abaicus commented Sep 1, 2023

@HardeepAsrani could you please fix the conflicts on this PR? Thank you!

@HardeepAsrani
Copy link
Member Author

@abaicus Should be fine to merge now.

@abaicus abaicus merged commit c2801db into next Sep 1, 2023
@abaicus abaicus deleted the fix/issue-517 branch September 1, 2023 08:08
@pirate-bot
Copy link
Collaborator

🎉 This PR is included in version 3.10.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@pirate-bot pirate-bot added the released Indicate that an issue has been resolved and released in a particular version of the product. label Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Indicate that an issue has been resolved and released in a particular version of the product.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants