-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Show "Verify you email" if needed before creating a site #24281
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
Conversation
|
App Name | ![]() |
|
Configuration | Release-Alpha | |
Build Number | pr24281-4254e7e | |
Version | 25.8 | |
Bundle ID | com.jetpack.alpha | |
Commit | 4254e7e | |
App Center Build | jetpack-installable-builds #10805 |
|
App Name | ![]() |
|
Configuration | Release-Alpha | |
Build Number | pr24281-4254e7e | |
Version | 25.8 | |
Bundle ID | org.wordpress.alpha | |
Commit | 4254e7e | |
App Center Build | WPiOS - One-Offs #11779 |
While testing this PR, I have the impression that the password is not properly set during the registration process, but I do not think it's strictly related to this PR and probably not related to the mobile app (but not 100% sure). I followed these steps:
|
if let account = try? WPAccount.lookupDefaultWordPressComAccount(in: ContextManager.shared.mainContext), | ||
account.needsEmailVerification { | ||
VerifyEmailModal.present(on: viewController) | ||
return | ||
} |
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.
I think there is an issue here. The needsEmailVerification
will be checked just locally from Core Data. So, if I verify the email and keep the app open, but also if I dismiss the verify email modal and reopen it, we do not check again if the email has been verified, so I'm stuck there. Therefore, I would suggest verifying every time the user taps to create a new site if the email needs verification. Additionally, add a button in VerifyEmailView
that allows the user to confirm they verified their email. This way, we can check remotely again if the email has been verified, and this view can be dismissed.
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.
Looks good, but I think we need to iterate a bit more on it. I'd suggest:
- Use
EmptyStateView
, which is designed for full-screen presentation.
EmptyStateView {
Label("Verify Your Email", systemImage: "envelope.badge")
} description: {
Text("We've sent an email to ") +
Text(verbatim: "[email protected]") // TODO: use L10n with an argument and AttributedString
.fontWeight(.medium) +
Text(" to verify your email address.")
} actions: {
VStack(alignment: .center, spacing: 8) {
Text("Haven't received an email? You might need to check you spam or tap the button below to resend it.")
.font(.footnote)
.foregroundStyle(.secondary)
.multilineTextAlignment(.center)
Button("Resend Email") {
// TODO:
}
}
.padding(.top, 16)
}

- Slightly change the default l10n.
Out of the scope of this PR
In addition, since this flow is part of the first-time user experience, it needs to be flawless. If email verification is required, it needs to be integrated in the site creation flow as its first (optional) step. You shouldn't need to click "Create Site" again after verifying your email.
Secondary, how does it make any sense that you need to confirm your email address before creating a site? I don't think it does. You created an account with a password, so you should be good. So, before making any changes, I would suggest to try addressing the root cause issue – email verification is required to create your first site.
No, it does not. You don't need to verify email to create a site on the website. The root cause is that the app can't get auth cookies on an unverified account. I can open an issue on WP.com, and hopefully, it can be addressed. Meanwhile, I think we should at least make the "Create your site" option possible for unverified accounts because, right now, they'll be asked to log in again from a web view (which may not even be possible for them). See #24205 for more context. |
The root cause, where the REST API does not return auth cookies for unverified accounts, will be addressed in the backend. This PR is no longer needed. |
Alternative solution of #24211. The same "verify your email" content on the me screen is presented as a modal when users with an unverified account tap the "Create a WordPress.com site" button.
Regression Notes
Potential unintended areas of impact
What I did to test those areas of impact (or what existing automated tests I relied on)
What automated tests I added (or what prevented me from doing so)
PR submission checklist:
RELEASE-NOTES.txt
if necessary.Testing checklist: