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

Domains: Don't allow unverified email for domain registration and G Suite #16166

Merged
merged 2 commits into from
Jul 31, 2017

Conversation

klimeryk
Copy link
Contributor

@klimeryk klimeryk commented Jul 13, 2017

Hattip for the idea to @iamgabrielma in p8Eqe3-aF-p2.

Just to be clear: in this patch, we're only interested in the WPCOM's email verification, not the ICANN one.

The WPCOM email is used by default for domain registration and G Suite purchases and it's important that it's a valid email. User might have made a typo in their email during registration and we should wait for them to verify the email before allowing further purchases that uses that email.
Domain mapping, site redirect and plans don't require email for verification, etc. so I did not restrict purchasing them.

I've started with a custom component, but then discovered we already have a very nice one used by different parts of our code, so I've used it to keep it consistent. It's also pretty cool and depends on Redux state - so as soon as you verify your email, it will disappear and re-activate the component it's "gating".

Testing

  • Check that Domains -> Add is gated like this when the email is not verified:

screen shot 2017-07-13 at 02 09 30

  • Check that Domains -> Email is gated like this when the email is not verified:

screen shot 2017-07-13 at 02 09 42

  • Check that Domains -> Email is gated like this when the email is not verified, but! Make sure the Email Forwarding option at the bottom is still accessible:

screen shot 2017-07-13 at 02 11 19

  • User should be able to manage existing G Suite users, regardless of the email's status:

screen shot 2017-07-13 at 02 07 37

  • But if they try to add a new user, they should be blocked:

screen shot 2017-07-13 at 02 08 25

  • Check that the user can buy domain mapping, site redirect and plans regardless of the email's status.

  • Make sure that all of the above do not impact NUX and signup.

For easier testing, you could just modify the isCurrentUserEmailVerified selector to always return true.
Or, you know, just create a new user ;)

Known issues and limitations

  1. The most important one: once you verify your account, then even if you submit a new email and it's pending verification, your account is still marked as verified. So don't be surprised if you try to update your existing account's email and you won't see the above gates. Unfortunately, this other verification status is not stored with the user, but in user settings. Which we don't fetch other than in /me. The component I re-used does not check it either, so I stuck with it as-is for consistency's sake with the rest of the app. But if turns out that the email updates, not the first verification, is what causes the majority of the issues, we can revisit this.
  2. Since we're blocking the whole domain search, we're also blocking the Already own a domain? part there (which is an integral part of the component and can't be easily excluded), so the user can't map a domain from there. They can still visit Settings and click the small link to map their domain there - of visit domains/add/mapping/ ;P

cc @ehti for sanity check from Domain Guild perspective 🙇

Igor Klimer added 2 commits July 12, 2017 22:14
The WPCOM email is used by default for domain registration and G Suite
purchases and it's important that it's a valid email. User might have
made a typo in their email during registration and we should wait for
them to verify the email before allowing further purchases.
Comonents in an array need to have unique keys
@klimeryk klimeryk added [Feature Group] Emails & Domains Features related to email integrations and domain management. G Suite [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Jul 13, 2017
@klimeryk klimeryk self-assigned this Jul 13, 2017
@matticbot matticbot added the [Size] L Large sized issue label Jul 13, 2017
@matticbot
Copy link
Contributor

return (
<Main className="domain-management-add-google-apps">
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This class is not defined anywhere and seems to be useless.

Copy link
Contributor

@delputnam delputnam left a comment

Choose a reason for hiding this comment

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

This all looks good and works as expected (within the documented limitations) for me. I have nothing to nitpick. Nice job! 👍

@ehti
Copy link

ehti commented Jul 13, 2017

It's a great idea.

In this case, we're (and should be) allowing domain/email purchases as part of NUX, right? For any new user signing up, they can purchase anything they want along with account creation.

We're going to check if WPCOM email is verified if they make any subsequent domain/email purchases. I'm not too sure how often we come across this scenario though, but no matter how rare or often, it's good to check.

It won't affect multiple domain purchases (new user) via /domains either, right?

User might have made a typo in their email during registration and we should wait for them to verify the email

Yep, though a small nitpick. We're only showing them Resend Email. If it's a typo, should we also be pointing them to /me/account to check/correct the email?

@klimeryk
Copy link
Contributor Author

klimeryk commented Jul 13, 2017

We're going to check if WPCOM email is verified if they make any subsequent domain/email purchases.

Yup, that's the only case - signup/NUX and /domains are not affected.

Yep, though a small nitpick. We're only showing them Resend Email. If it's a typo, should we also be pointing them to /me/account to check/correct the email?

Good point, though, I'm re-using an existing component and don't want to modify it too much. FWIW, we do show the email when we re-send the verification email, so that should help the user (though, of course, some typos are hard to catch):
cakk8apl3y

I'm now thinking that a better option would be to re-use the notice that @mikeshelton1503 introduced in #15880 🤔 Mike, what do you think? On one hand, the component I'm using now is used in other parts of Calypso. So if we were to re-use the new designs, we should do that Calypso-wide, integrating the new designs into the existing component.

@ehti
Copy link

ehti commented Jul 13, 2017

FWIW, we do show the email when we re-send the verification email

The gif looks a lot better! I know I called it a small nitpick, but I also knew the implementation is going to be far from small! 😆

Good with this design too as the email is visible.

@klimeryk klimeryk removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jul 31, 2017
@klimeryk klimeryk merged commit be4eb83 into master Jul 31, 2017
@klimeryk klimeryk deleted the fix/dont-allow-unverified-email-for-domain-reg branch July 31, 2017 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature Group] Emails & Domains Features related to email integrations and domain management. G Suite [Size] L Large sized issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants