Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3216,6 +3216,8 @@ MonoBehaviour:
<CancelLoginButton>k__BackingField: {fileID: 9108319191272288200}
<EmailOTPContainer>k__BackingField: {fileID: 5285033395635913484}
<EmailInputField>k__BackingField: {fileID: 2001940849056367380}
<OtherLoginContainer>k__BackingField: {fileID: 5887702060069110797}
<ContinueWithTextContainer>k__BackingField: {fileID: 3844889584895123327}
<LoginMetamaskButton>k__BackingField: {fileID: 4481630630708771614}
<LoginGoogleButton>k__BackingField: {fileID: 9078712830092277137}
<LoginDiscordButton>k__BackingField: {fileID: 8034867738283704265}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,15 @@
using DCL.Profiles;
using DCL.Profiles.Self;
using DCL.SceneLoadingScreens.SplashScreen;
using DCL.Settings.Utils;
using DCL.UI;
using DCL.Utilities;
using DCL.Utility;
using DCL.Web3.Authenticators;
using DCL.Web3.Identities;
using DCL.WebRequests;
using Global.AppArgs;
using MVC;
using System;
using System.Collections.Generic;
using System.Threading;
using UnityEngine;
using Utility;

namespace DCL.AuthenticationScreenFlow
Expand All @@ -49,6 +45,7 @@ public enum AuthStatus

internal const int ANIMATION_DELAY = 300;
internal const string LOADING_TRANSACTION_NAME = "loading_process";
private const string EPIC_STORE_INSTALL_SOURCE = "epic";

private readonly ICompositeWeb3Provider web3Authenticator;
private readonly ISelfProfile selfProfile;
Expand Down Expand Up @@ -150,9 +147,13 @@ protected override void OnViewInstantiated()
base.OnViewInstantiated();

audio = new AuthenticationScreenAudio(viewInstance, audioMixerVolumesController, backgroundMusic);
characterPreviewController = new AuthenticationScreenCharacterPreviewController(viewInstance.CharacterPreviewView, emotesSettings, characterPreviewFactory, world, characterPreviewEventBus);
characterPreviewController = new AuthenticationScreenCharacterPreviewController(viewInstance!.CharacterPreviewView, emotesSettings, characterPreviewFactory, world, characterPreviewEventBus);

bool enableEmailOTP = FeaturesRegistry.Instance.IsEnabled(FeatureId.EmailOTPAuth);
bool isEpicBuild = string.Equals(installSource, EPIC_STORE_INSTALL_SOURCE, StringComparison.OrdinalIgnoreCase);
// Epic builds only support emailOTP due to deeplink limitations
// See: https://github.com/decentraland/unity-explorer/issues/9554
bool enableEmailOTP = FeaturesRegistry.Instance.IsEnabled(FeatureId.EmailOTPAuth) || isEpicBuild;
bool otherLoginMethodsEnabled = !isEpicBuild;
viewInstance.LoginSelectionAuthView.EmailOTPContainer.SetActive(enableEmailOTP);

viewInstance.DiscordButton.onClick.AddListener(OpenSupportUrl);
Expand All @@ -163,7 +164,8 @@ protected override void OnViewInstantiated()

fsm.AddStates(
new InitAuthState(viewInstance, installSource),
new LoginSelectionAuthState(fsm, viewInstance, this, CurrentState, splashScreen, web3Authenticator, webBrowser, enableEmailOTP),
new LoginSelectionAuthState(fsm, viewInstance, this, CurrentState, splashScreen, web3Authenticator, webBrowser,
enableEmailOTP, otherLoginMethodsEnabled),
new ProfileFetchingAuthState(fsm, viewInstance, this, CurrentState, selfProfile, storedIdentityProvider),
new IdentityVerificationDappDeepLinkAuthState(fsm, viewInstance, this, CurrentState, web3Authenticator),
new LobbyForExistingAccountAuthState(fsm, viewInstance, this, splashScreen, CurrentState, characterPreviewController),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@ public class LoginSelectionAuthState : AuthStateBase, IState, IPayloadedState<Er
private readonly ICompositeWeb3Provider compositeWeb3Provider;
private readonly UnityAppWebBrowser webBrowser;
private readonly bool enableEmailOTP;
private readonly bool otherLoginMethodsEnabled;

public LoginSelectionAuthState(MVCStateMachine<AuthStateBase> machine,
AuthenticationScreenView viewInstance, AuthenticationScreenController controller,
ReactiveProperty<AuthStatus> currentState, SplashScreen splashScreen,
ICompositeWeb3Provider compositeWeb3Provider, UnityAppWebBrowser webBrowser, bool enableEmailOTP) : base(viewInstance)
ICompositeWeb3Provider compositeWeb3Provider, UnityAppWebBrowser webBrowser,
bool enableEmailOTP,
bool otherLoginMethodsEnabled) : base(viewInstance)
{
view = viewInstance.LoginSelectionAuthView;

Expand All @@ -39,6 +42,7 @@ public LoginSelectionAuthState(MVCStateMachine<AuthStateBase> machine,
this.compositeWeb3Provider = compositeWeb3Provider;
this.webBrowser = webBrowser;
this.enableEmailOTP = enableEmailOTP;
this.otherLoginMethodsEnabled = otherLoginMethodsEnabled;

// Cancel button persists in the Verification state (until code is shown)
view.CancelLoginButton.onClick.AddListener(OnCancelBeforeVerification);
Expand Down Expand Up @@ -136,7 +140,7 @@ public void Enter(int animHash)
if (splashScreen != null) // it can be destroyed after first login
splashScreen.FadeOutAndHide();

view.Show(animHash, moreOptionsExpanded: !enableEmailOTP);
view.Show(animHash, moreOptionsExpanded: !enableEmailOTP, otherLoginMethodsEnabled);
Enter();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ public class LoginSelectionAuthView : ViewBase
public EmailInputFieldView EmailInputField { get; private set; } = null!;

[field: Header("SECONDARY LOGINS")]
[field: SerializeField]
public GameObject OtherLoginContainer { get; private set; } = null!;

[field: SerializeField]
public GameObject ContinueWithTextContainer { get; private set; } = null!;

[field: SerializeField]
public Button LoginMetamaskButton { get; private set; } = null!;

Expand Down Expand Up @@ -103,13 +109,15 @@ private void SetOptionsPanelVisibility(bool isExpanded)
moreOptionsPanel.SetActive(isExpanded);
}

public void Show(int animHash, bool moreOptionsExpanded)
public void Show(int animHash, bool moreOptionsExpanded, bool otherLoginMethodsEnabled)
{
showAnimHash = animHash;
ShowAsync(CancellationToken.None).Forget();

areOptionsExpanded = moreOptionsExpanded;
SetOptionsPanelVisibility(areOptionsExpanded);
OtherLoginContainer.SetActive(otherLoginMethodsEnabled);
ContinueWithTextContainer.SetActive(otherLoginMethodsEnabled && !moreOptionsExpanded);
SetOptionsPanelVisibility(areOptionsExpanded && otherLoginMethodsEnabled);

SetLoadingSpinnerVisibility(false);
}
Expand Down
Loading