Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.

Commit 552d2d3

Browse files
Merge pull request #655 from wordpress-mobile/wcios/verifyEmailScreen
[Sign in with site address] - Introduce verify email instructions screen.
2 parents b3bcb7f + 8dfd81a commit 552d2d3

File tree

15 files changed

+451
-15
lines changed

15 files changed

+451
-15
lines changed

WordPressAuthenticator.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Pod::Spec.new do |s|
44
s.name = 'WordPressAuthenticator'
5-
s.version = '2.1.1'
5+
s.version = '2.2.0-beta.1'
66

77
s.summary = 'WordPressAuthenticator implements an easy and elegant way to authenticate your WordPress Apps.'
88
s.description = <<-DESC

WordPressAuthenticator.xcodeproj/project.pbxproj

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@
166166
D881A315256B5B5800FE5605 /* NavigateToEnterAccount.swift in Sources */ = {isa = PBXBuildFile; fileRef = D881A314256B5B5800FE5605 /* NavigateToEnterAccount.swift */; };
167167
E8AF6B9EF50902F2117DFAF9 /* Pods_WordPressAuthenticatorTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5A441EC80D2B8D2209C2E228 /* Pods_WordPressAuthenticatorTests.framework */; };
168168
EE633D02287560E50002DE03 /* UITableView+Helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE633D01287560E50002DE03 /* UITableView+Helpers.swift */; };
169+
EEEAC912289272F20066D419 /* VerifyEmailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEEAC911289272F20066D419 /* VerifyEmailViewController.swift */; };
170+
EEEAC9142892731E0066D419 /* VerifyEmail.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EEEAC9132892731E0066D419 /* VerifyEmail.storyboard */; };
169171
F11448EC258B827B0048203D /* URL+JetpackConnect.swift in Sources */ = {isa = PBXBuildFile; fileRef = F11448EB258B827B0048203D /* URL+JetpackConnect.swift */; };
170172
F12F9FB424D8A68E00771BCE /* AuthenticatorAnalyticsTracker.swift in Sources */ = {isa = PBXBuildFile; fileRef = F12F9FB324D8A68E00771BCE /* AuthenticatorAnalyticsTracker.swift */; };
171173
F12F9FB824D8A7FC00771BCE /* AnalyticsTrackerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F12F9FB724D8A7FC00771BCE /* AnalyticsTrackerTests.swift */; };
@@ -378,6 +380,8 @@
378380
D881A314256B5B5800FE5605 /* NavigateToEnterAccount.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigateToEnterAccount.swift; sourceTree = "<group>"; };
379381
E9414A95E29F3297555AC92B /* Pods-WordPressAuthenticator.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WordPressAuthenticator.debug.xcconfig"; path = "Pods/Target Support Files/Pods-WordPressAuthenticator/Pods-WordPressAuthenticator.debug.xcconfig"; sourceTree = "<group>"; };
380382
EE633D01287560E50002DE03 /* UITableView+Helpers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UITableView+Helpers.swift"; sourceTree = "<group>"; };
383+
EEEAC911289272F20066D419 /* VerifyEmailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VerifyEmailViewController.swift; sourceTree = "<group>"; };
384+
EEEAC9132892731E0066D419 /* VerifyEmail.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = VerifyEmail.storyboard; sourceTree = "<group>"; };
381385
F11448EB258B827B0048203D /* URL+JetpackConnect.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "URL+JetpackConnect.swift"; sourceTree = "<group>"; };
382386
F12F9FB324D8A68E00771BCE /* AuthenticatorAnalyticsTracker.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AuthenticatorAnalyticsTracker.swift; sourceTree = "<group>"; };
383387
F12F9FB724D8A7FC00771BCE /* AnalyticsTrackerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalyticsTrackerTests.swift; sourceTree = "<group>"; };
@@ -852,6 +856,7 @@
852856
CEC77C6424854EE400FB9050 /* View Related */ = {
853857
isa = PBXGroup;
854858
children = (
859+
EEEAC91028926F7D0066D419 /* VerifyEmail */,
855860
98BC47E124F5B959000275AD /* Get Started */,
856861
984D508024D4B1FD00251A63 /* Password */,
857862
988AD89F24CB820200BD045E /* 2FA */,
@@ -914,6 +919,15 @@
914919
path = Navigation;
915920
sourceTree = "<group>";
916921
};
922+
EEEAC91028926F7D0066D419 /* VerifyEmail */ = {
923+
isa = PBXGroup;
924+
children = (
925+
EEEAC911289272F20066D419 /* VerifyEmailViewController.swift */,
926+
EEEAC9132892731E0066D419 /* VerifyEmail.storyboard */,
927+
);
928+
path = VerifyEmail;
929+
sourceTree = "<group>";
930+
};
917931
F12F9FB524D8A7DB00771BCE /* Analytics */ = {
918932
isa = PBXGroup;
919933
children = (
@@ -1067,6 +1081,7 @@
10671081
984D508424D4B24500251A63 /* Password.storyboard in Resources */,
10681082
CE811D6924EDC14A00F4CCD6 /* LoginMagicLink.storyboard in Resources */,
10691083
98ED48392480300500992B2D /* GoogleAuth.storyboard in Resources */,
1084+
EEEAC9142892731E0066D419 /* VerifyEmail.storyboard in Resources */,
10701085
CE1BBF8D24D48580001D2E3E /* GravatarEmailTableViewCell.xib in Resources */,
10711086
B560913F208A563800399AE4 /* Login.storyboard in Resources */,
10721087
CE6BCD3924A3CB5E001BCDC5 /* TextLinkButtonTableViewCell.xib in Resources */,
@@ -1232,6 +1247,7 @@
12321247
B5ED7920207E993E00A8FD8C /* WPAuthenticatorLogging.m in Sources */,
12331248
B5609138208A563800399AE4 /* LoginSiteAddressViewController.swift in Sources */,
12341249
B560910B208A54F800399AE4 /* LoginFacade.m in Sources */,
1250+
EEEAC912289272F20066D419 /* VerifyEmailViewController.swift in Sources */,
12351251
CE30A2AD2257CECC00DF3CDA /* AuthenticatorCredentials.swift in Sources */,
12361252
B5609145208A563800399AE4 /* LoginViewController.swift in Sources */,
12371253
B5609139208A563800399AE4 /* LoginEmailViewController.swift in Sources */,

WordPressAuthenticator/Analytics/AuthenticatorAnalyticsTracker.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ public class AuthenticatorAnalyticsTracker {
121121

122122
/// When we ask user to input the code from the 2 factor authentication
123123
case twoFactorAuthentication = "2fa"
124+
125+
/// Triggered when a user enters site credentials and sees the screen with instructions to verify email. (`VerifyEmailViewController`)
126+
///
127+
case verifyEmailInstructions = "instructions_to_verify_email"
124128
}
125129

126130
public enum ClickTarget: String {
@@ -237,6 +241,10 @@ public class AuthenticatorAnalyticsTracker {
237241
/// When the user taps of "Sign in with site credentials" button in `GetStartedViewController`
238242
///
239243
case signInWithSiteCredentials = "sign_in_with_site_credentials"
244+
245+
/// When the user clicks on “Login with account password” on `VerifyEmailViewController`
246+
///
247+
case loginWithAccountPassword = "login_with_password"
240248
}
241249

242250
/// Shared Instance.

WordPressAuthenticator/Authenticator/WordPressAuthenticatorDisplayStrings.swift

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ public struct WordPressAuthenticatorDisplayStrings {
1515
public let magicLinkSignupInstructions: String
1616
public let openMailSignupInstructions: String
1717
public let openMailLoginInstructions: String
18+
public let verifyMailLoginInstructions: String
19+
public let alternativelyEnterPasswordInstructions: String
1820
public let checkSpamInstructions: String
1921
public let oopsInstructions: String
2022
public let googleSignupInstructions: String
@@ -30,6 +32,8 @@ public struct WordPressAuthenticatorDisplayStrings {
3032
public let continueWithWPButtonTitle: String
3133
public let enterYourSiteAddressButtonTitle: String
3234
public let signInWithSiteCredentialsButtonTitle: String
35+
public let sendEmailVerificationLinkButtonTitle: String
36+
public let loginWithAccountPasswordButtonTitle: String
3337

3438
/// Large titles displayed in unified auth flows.
3539
///
@@ -68,6 +72,8 @@ public struct WordPressAuthenticatorDisplayStrings {
6872
magicLinkSignupInstructions: String = defaultStrings.magicLinkSignupInstructions,
6973
openMailSignupInstructions: String = defaultStrings.openMailSignupInstructions,
7074
openMailLoginInstructions: String = defaultStrings.openMailLoginInstructions,
75+
verifyMailLoginInstructions: String = defaultStrings.verifyMailLoginInstructions,
76+
alternativelyEnterPasswordInstructions: String = defaultStrings.alternativelyEnterPasswordInstructions,
7177
checkSpamInstructions: String = defaultStrings.checkSpamInstructions,
7278
oopsInstructions: String = defaultStrings.oopsInstructions,
7379
googleSignupInstructions: String = defaultStrings.googleSignupInstructions,
@@ -80,6 +86,8 @@ public struct WordPressAuthenticatorDisplayStrings {
8086
continueWithWPButtonTitle: String = defaultStrings.continueWithWPButtonTitle,
8187
enterYourSiteAddressButtonTitle: String = defaultStrings.enterYourSiteAddressButtonTitle,
8288
signInWithSiteCredentialsButtonTitle: String = defaultStrings.signInWithSiteCredentialsButtonTitle,
89+
sendEmailVerificationLinkButtonTitle: String = defaultStrings.sendEmailVerificationLinkButtonTitle,
90+
loginWithAccountPasswordButtonTitle: String = defaultStrings.loginWithAccountPasswordButtonTitle,
8391
findSiteButtonTitle: String = defaultStrings.findSiteButtonTitle,
8492
resetPasswordButtonTitle: String = defaultStrings.resetPasswordButtonTitle,
8593
getLoginLinkButtonTitle: String = defaultStrings.getLoginLinkButtonTitle,
@@ -106,6 +114,8 @@ public struct WordPressAuthenticatorDisplayStrings {
106114
self.magicLinkSignupInstructions = magicLinkSignupInstructions
107115
self.openMailSignupInstructions = openMailSignupInstructions
108116
self.openMailLoginInstructions = openMailLoginInstructions
117+
self.verifyMailLoginInstructions = verifyMailLoginInstructions
118+
self.alternativelyEnterPasswordInstructions = alternativelyEnterPasswordInstructions
109119
self.checkSpamInstructions = checkSpamInstructions
110120
self.oopsInstructions = oopsInstructions
111121
self.googleSignupInstructions = googleSignupInstructions
@@ -118,6 +128,8 @@ public struct WordPressAuthenticatorDisplayStrings {
118128
self.continueWithWPButtonTitle = continueWithWPButtonTitle
119129
self.enterYourSiteAddressButtonTitle = enterYourSiteAddressButtonTitle
120130
self.signInWithSiteCredentialsButtonTitle = signInWithSiteCredentialsButtonTitle
131+
self.sendEmailVerificationLinkButtonTitle = sendEmailVerificationLinkButtonTitle
132+
self.loginWithAccountPasswordButtonTitle = loginWithAccountPasswordButtonTitle
121133
self.findSiteButtonTitle = findSiteButtonTitle
122134
self.resetPasswordButtonTitle = resetPasswordButtonTitle
123135
self.getLoginLinkButtonTitle = getLoginLinkButtonTitle
@@ -160,6 +172,10 @@ public extension WordPressAuthenticatorDisplayStrings {
160172
comment: "Instruction text after a signup Magic Link was requested."),
161173
openMailLoginInstructions: NSLocalizedString("Check your email on this device, and tap the link in the email you receive from WordPress.com.",
162174
comment: "Instruction text after a login Magic Link was requested."),
175+
verifyMailLoginInstructions: NSLocalizedString("A WordPress.com account is connected to your store credentials. To continue, we will send a verification link to the email address above.",
176+
comment: "Instruction text to explain magic link login step."),
177+
alternativelyEnterPasswordInstructions: NSLocalizedString("Alternatively, you may enter the password for this account.",
178+
comment: "Instruction text to explain to help users type their password instead of using magic link login option."),
163179
checkSpamInstructions: NSLocalizedString("Not seeing the email? Check your Spam or Junk Mail folder.", comment: "Instructions after a Magic Link was sent, but the email can't be found in their inbox."),
164180
oopsInstructions: NSLocalizedString("Didn't mean to create a new account? Go back to re-enter your email address.", comment: "Instructions after a Magic Link was sent, but email is incorrect."),
165181
googleSignupInstructions: NSLocalizedString("We'll use this email address to create your new WordPress.com account.", comment: "Text confirming email address to be used for new account."),
@@ -181,6 +197,10 @@ public extension WordPressAuthenticatorDisplayStrings {
181197
comment: "Button title. Takes the user to the login by site address flow."),
182198
signInWithSiteCredentialsButtonTitle: NSLocalizedString("Sign in with site credentials",
183199
comment: "Button title. Takes the user the Enter site credentials screen."),
200+
sendEmailVerificationLinkButtonTitle: NSLocalizedString("Send email verification link",
201+
comment: "Button title. Sends a email verification link (Magin link) for signing in."),
202+
loginWithAccountPasswordButtonTitle: NSLocalizedString("Login with account password",
203+
comment: "Button title. Takes the user to the Enter account password screen."),
184204
findSiteButtonTitle: NSLocalizedString("Find your site address",
185205
comment: "The hint button's title text to help users find their site address."),
186206
resetPasswordButtonTitle: NSLocalizedString("Reset your password",

WordPressAuthenticator/Authenticator/WordPressAuthenticatorStyles.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,10 @@ public struct WordPressAuthenticatorUnifiedStyle {
230230
public let navButtonTextColor: UIColor
231231
public let navTitleTextColor: UIColor
232232

233+
/// Style: Text color to be used for email in `GravatarEmailTableViewCell`
234+
///
235+
public let gravatarEmailTextColor: UIColor?
236+
233237
/// Designated initializer
234238
///
235239
public init(borderColor: UIColor,
@@ -244,7 +248,8 @@ public struct WordPressAuthenticatorUnifiedStyle {
244248
statusBarStyle: UIStatusBarStyle = .default,
245249
navBarBackgroundColor: UIColor,
246250
navButtonTextColor: UIColor,
247-
navTitleTextColor: UIColor) {
251+
navTitleTextColor: UIColor,
252+
gravatarEmailTextColor: UIColor? = nil) {
248253
self.borderColor = borderColor
249254
self.errorColor = errorColor
250255
self.textColor = textColor
@@ -258,5 +263,6 @@ public struct WordPressAuthenticatorUnifiedStyle {
258263
self.navBarBackgroundColor = navBarBackgroundColor
259264
self.navButtonTextColor = navButtonTextColor
260265
self.navTitleTextColor = navTitleTextColor
266+
self.gravatarEmailTextColor = gravatarEmailTextColor
261267
}
262268
}

WordPressAuthenticator/Authenticator/WordPressSupportSourceTag.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ extension WordPressSupportSourceTag {
3838
public static var loginSiteAddress: WordPressSupportSourceTag {
3939
return WordPressSupportSourceTag(name: "loginSiteAddress", origin: "origin:login-site-address")
4040
}
41+
42+
/// For `VerifyEmailViewController`
43+
public static var verifyEmailInstructions: WordPressSupportSourceTag {
44+
WordPressSupportSourceTag(name: "verifyEmailInstructions", origin: "origin:login-site-address")
45+
}
46+
4147
public static var loginUsernamePassword: WordPressSupportSourceTag {
4248
return WordPressSupportSourceTag(name: "loginUsernamePassword", origin: "origin:login-username-password")
4349
}

WordPressAuthenticator/Extensions/UIStoryboard+Helpers.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ enum Storyboard: String {
1313
case googleSignupConfirmation = "GoogleSignupConfirmation"
1414
case twoFA = "TwoFA"
1515
case password = "Password"
16+
case verifyEmail = "VerifyEmail"
1617

1718
var instance: UIStoryboard {
1819
return UIStoryboard(name: self.rawValue, bundle: WordPressAuthenticator.bundle)

WordPressAuthenticator/Unified Auth/View Related/Reusable Views/GravatarEmailTableViewCell.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class GravatarEmailTableViewCell: UITableViewCell {
2020
///
2121
public func configure(withEmail email: String?, andPlaceholder placeholderImage: UIImage? = nil) {
2222
gravatarImageView?.tintColor = WordPressAuthenticator.shared.unifiedStyle?.borderColor ?? WordPressAuthenticator.shared.style.primaryNormalBorderColor
23-
emailLabel?.textColor = WordPressAuthenticator.shared.unifiedStyle?.textSubtleColor ?? WordPressAuthenticator.shared.style.subheadlineColor
23+
emailLabel?.textColor = WordPressAuthenticator.shared.unifiedStyle?.gravatarEmailTextColor ?? WordPressAuthenticator.shared.unifiedStyle?.textSubtleColor ?? WordPressAuthenticator.shared.style.subheadlineColor
2424
emailLabel?.font = UIFont.preferredFont(forTextStyle: .body)
2525
emailLabel?.text = email
2626

WordPressAuthenticator/Unified Auth/View Related/Reusable Views/GravatarEmailTableViewCell.xib

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="19455" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
33
<device id="retina6_1" orientation="portrait" appearance="light"/>
44
<dependencies>
55
<deployment identifier="iOS"/>
6-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19454"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
77
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
88
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
99
</dependencies>
@@ -18,15 +18,15 @@
1818
<autoresizingMask key="autoresizingMask"/>
1919
<subviews>
2020
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="odI-Gb-fXa" customClass="CircularImageView" customModule="WordPressAuthenticator">
21-
<rect key="frame" x="11" y="11" width="48" height="48"/>
21+
<rect key="frame" x="16" y="11" width="48" height="48"/>
2222
<constraints>
2323
<constraint firstAttribute="height" constant="48" id="RU3-mW-PAl"/>
2424
<constraint firstAttribute="width" secondItem="odI-Gb-fXa" secondAttribute="height" multiplier="1:1" id="TSH-sA-5Pw"/>
2525
<constraint firstAttribute="width" constant="48" id="oKU-lB-dYx"/>
2626
</constraints>
2727
</imageView>
2828
<textField opaque="NO" userInteractionEnabled="NO" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="Email Label" textAlignment="natural" adjustsFontForContentSizeCategory="YES" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="3kD-7a-MeN">
29-
<rect key="frame" x="70" y="13" width="239" height="44"/>
29+
<rect key="frame" x="75" y="13" width="229" height="44"/>
3030
<accessibility key="accessibilityConfiguration">
3131
<accessibilityTraits key="traits" staticText="YES"/>
3232
</accessibility>
@@ -42,11 +42,11 @@
4242
</subviews>
4343
<constraints>
4444
<constraint firstItem="3kD-7a-MeN" firstAttribute="leading" secondItem="odI-Gb-fXa" secondAttribute="trailing" constant="11" id="M5P-4D-Dig"/>
45-
<constraint firstAttribute="trailing" secondItem="3kD-7a-MeN" secondAttribute="trailing" constant="11" id="Uu4-bo-sjK"/>
45+
<constraint firstAttribute="trailing" secondItem="3kD-7a-MeN" secondAttribute="trailing" constant="16" id="Uu4-bo-sjK"/>
4646
<constraint firstItem="odI-Gb-fXa" firstAttribute="bottom" secondItem="H2p-sc-9uM" secondAttribute="bottomMargin" constant="-2" id="YZD-yX-ic3"/>
4747
<constraint firstItem="3kD-7a-MeN" firstAttribute="centerY" secondItem="odI-Gb-fXa" secondAttribute="centerY" id="guc-Ls-SYV"/>
4848
<constraint firstItem="odI-Gb-fXa" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="topMargin" id="hPB-Uy-lLS"/>
49-
<constraint firstItem="odI-Gb-fXa" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="11" id="kVa-7e-I73"/>
49+
<constraint firstItem="odI-Gb-fXa" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="kVa-7e-I73"/>
5050
</constraints>
5151
</tableViewCellContentView>
5252
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/>

0 commit comments

Comments
 (0)