You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have recently replaced email/password auth with email link sign-in. A few users have reported that they receive the email to log in and the URL opens the app but they get stuck behind the sign-in wall.
Steps to reproduce:
Enter the email address
Open the received email
Click the link on the email
Then it takes me back again to the login page.
It's an infinite loop
Relevant Code:
@Override
protected void onCreate(Bundle savedInstanceState) {
...
handleDynamicLinks(getIntent());
}
@Override
protected void onNewIntent(Intent intent) {
...
handleDynamicLinks(intent);
}
private Intent buildSignInIntent(boolean onlyGoogle) {
List<AuthUI.IdpConfig> selectedProviders = new ArrayList<>();
ActionCodeSettings actionCodeSettings = ActionCodeSettings.newBuilder()
.setIOSBundleId("XXX-ios")
.setAndroidPackageName(
/* yourPackageName= */ "XXX.android",
/* installIfNotAvailable= */ true,
/* minimumVersion= */ null)
.setHandleCodeInApp(true) // This must be set to true
.setUrl("AUTH_DOMAIN") // This URL needs to be whitelisted
.build();
selectedProviders.addAll(Arrays.asList(
new AuthUI.IdpConfig.EmailBuilder()
.enableEmailLinkSignIn()
.setActionCodeSettings(actionCodeSettings).build(),
new AuthUI.IdpConfig.FacebookBuilder().build(),
new AuthUI.IdpConfig.GoogleBuilder().build()
));
if (enableAppleSignin()) {
selectedProviders.add(2, new AuthUI.IdpConfig.AppleBuilder().build());
}
}
AuthMethodPickerLayout customLayout = new AuthMethodPickerLayout
.Builder(R.layout.fragment_register)
.setGoogleButtonId(R.id.custom_google_signin_button)
.setEmailButtonId(R.id.custom_email_signin_button)
.setFacebookButtonId(R.id.custom_facebook_signin_button)
.setAppleButtonId(R.id.custom_apple_signin_button)
.setTosAndPrivacyPolicyId(R.id.custom_tos)
.build();
return AuthUI.getInstance().createSignInIntentBuilder()
.setIsSmartLockEnabled(onlyGoogle /* credentials */, true)
.setLogo(AuthUI.NO_LOGO)
.setTheme(R.style.AppTheme)
.setAvailableProviders(selectedProviders)
.setAuthMethodPickerLayout(customLayout)
.setTosAndPrivacyPolicyUrls(Constants.TermsOfUseURL, Constants.PrivacyPolicyURL)
.build();
}
....
private void handleDynamicLinks(Intent intent) {
if (AuthUI.canHandleIntent(intent)) {
if (intent.getExtras() == null) {
return;
}
String link = intent.getData().toString();
Intent signInIntent = AuthUI.getInstance()
.createSignInIntentBuilder()
.setEmailLink(link)
.setLogo(AuthUI.NO_LOGO)
.setTheme(R.style.AppTheme)
.setAvailableProviders(Collections.emptyList())
.build();
signInLauncher.launch(signInIntent);
}
}
The implementation works fine on most of the devices but some users are facing this issue. It seems the dynamic link is handled differently on different devices.
In my case, sometimes the splash screen (not the login screen) was capturing the link. So I checked AuthUI.canHandleIntent(intent) on the splash and if needed extracted the link and manually passed it to the login screen. I didn't get any report after this change.
Describe your environment
Android device: Advan Tablet Sketsa 2
Android OS version: Android 11
FirebaseUI version: 8.0.1
Android device: Realme GT2 Pro
Android OS version: Android 12
FirebaseUI version: 8.0.1
Step 3: Describe the problem:
We have recently replaced email/password auth with email link sign-in. A few users have reported that they receive the email to log in and the URL opens the app but they get stuck behind the sign-in wall.
Steps to reproduce:
It's an infinite loop
Relevant Code:
AndroidManifest.xml
The text was updated successfully, but these errors were encountered: