-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
MBL-1233: Consolidate login and signup buttons when OAuth is enabled #1956
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,6 +97,10 @@ public protocol LoginToutViewModelOutputs { | |
|
||
/// Emits an access token to show 2fa view when Facebook login fails with tfaRequired error | ||
var startTwoFactorChallenge: Signal<String, Never> { get } | ||
|
||
/// True if the feature flag for OAuth login is true. | ||
/// Note that this is not a signal, because we don't want it to ever change after the screen is loaded. | ||
var loginWithOAuthEnabled: Bool { get } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is perhaps a bit of a paranoid move, but since login is something you might do right after launch, I didn't want there to ever be a situation where the remote config reloads after the login screen has already been presented. This way, this property is set when the view controller is initialized, and never changes. |
||
} | ||
|
||
public protocol LoginToutViewModelType { | ||
|
@@ -265,6 +269,7 @@ public final class LoginToutViewModel: LoginToutViewModelType, LoginToutViewMode | |
|
||
self.logIntoEnvironmentWithApple = logIntoEnvironmentWithApple.signal | ||
self.logIntoEnvironmentWithFacebook = logIntoEnvironmentWithFacebook.signal | ||
self.loginWithOAuthEnabled = featureLoginWithOAuthEnabled() | ||
} | ||
|
||
public var inputs: LoginToutViewModelInputs { return self } | ||
|
@@ -354,6 +359,7 @@ public final class LoginToutViewModel: LoginToutViewModelType, LoginToutViewMode | |
public let startTwoFactorChallenge: Signal<String, Never> | ||
public let showAppleErrorAlert: Signal<String, Never> | ||
public let showFacebookErrorAlert: Signal<AlertError, Never> | ||
public let loginWithOAuthEnabled: Bool | ||
} | ||
|
||
private func statusString(_ forStatus: LoginIntent) -> String { | ||
|
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.
This will be a separate web PR + a follow-up to this PR once the strings are finished.