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

Commit 8591d33

Browse files
committed
Update SignInSource to be optional based on CR suggestion.
1 parent c70fc24 commit 8591d33

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

WordPressAuthenticator/Unified Auth/View Related/Get Started/GetStartedViewController.swift

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,19 @@ public enum SignInSource {
88
case wpCom
99
/// Initiated from the WP.com login flow that starts with site address.
1010
case wpComSiteAddress
11-
/// Other unspecified sources.
12-
case other
1311
}
1412

1513
/// The error during the sign in flow.
1614
public enum SignInError: Error {
1715
case invalidWPComEmail(source: SignInSource)
1816

19-
init?(error: Error, source: SignInSource) {
17+
init?(error: Error, source: SignInSource?) {
2018
let error = error as NSError
2119

2220
switch error.code {
2321
case WordPressComRestApiError.unknown.rawValue:
2422
let restAPIErrorCode = error.userInfo[WordPressComRestApi.ErrorKeyErrorCode] as? String
25-
if restAPIErrorCode == "unknown_user" {
23+
if let source = source, restAPIErrorCode == "unknown_user" {
2624
self = .invalidWPComEmail(source: source)
2725
} else {
2826
return nil
@@ -67,7 +65,7 @@ class GetStartedViewController: LoginViewController, NUXKeyboardResponder {
6765
// This is public so it can be set from StoredCredentialsAuthenticator.
6866
var errorMessage: String?
6967

70-
var source: SignInSource = .other
68+
var source: SignInSource?
7169

7270
private var rows = [Row]()
7371
private var buttonViewController: NUXButtonViewController?

0 commit comments

Comments
 (0)