File tree 2 files changed +12
-0
lines changed
auth/src/main/java/com/firebase/ui/auth/util/data
2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 2
2
- Restore ` setGithubButtonId ` when using custom layouts (#1783 )
3
3
- Improve how network errors display when they are non-fatal (#1803 )
4
4
- Warn instead of crashing when a reserved email is used (#1644 )
5
+ - Allow ` setAllowNewAccounts(false) ` to be used with email link sign in (#1762 )
Original file line number Diff line number Diff line change @@ -212,6 +212,17 @@ public Task<List<String>> then(@NonNull Task<SignInMethodQueryResult> task) {
212
212
}
213
213
}
214
214
215
+ // In this case the developer has configured EMAIL_LINK sign in but the
216
+ // user is a password user. The valid use case here is that the developer
217
+ // is using admin-created accounts and combining email-link sign in with
218
+ // setAllowNewAccounts(false). So we manually enable EMAIL_LINK. See:
219
+ // https://github.com/firebase/FirebaseUI-Android/issues/1762#issuecomment-661115293
220
+ if (allowedProviders .contains (EMAIL_LINK_PROVIDER )
221
+ && methods .contains (EmailAuthProvider .EMAIL_PASSWORD_SIGN_IN_METHOD )
222
+ && !methods .contains (EMAIL_LINK_PROVIDER )) {
223
+ lastSignedInProviders .add (0 , signInMethodToProviderId (EMAIL_LINK_PROVIDER ));
224
+ }
225
+
215
226
if (task .isSuccessful () && lastSignedInProviders .isEmpty ()
216
227
&& !methods .isEmpty ()) {
217
228
// There is an existing user who only has unsupported sign in methods
You can’t perform that action at this time.
0 commit comments