Skip to content

Commit b1a5ae9

Browse files
Lyokonethatfiredev
authored andcommitted
feat: remove email enumeration (#2184)
1 parent a10ee24 commit b1a5ae9

28 files changed

+1104
-1019
lines changed

app/src/main/AndroidManifest.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<manifest
33
xmlns:android="http://schemas.android.com/apk/res/android"
44
xmlns:tools="http://schemas.android.com/tools"
5-
>
5+
>
66

77
<uses-permission android:name="android.permission.INTERNET" />
88
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
@@ -41,7 +41,7 @@
4141
android:label="@string/title_auth_activity" />
4242
<activity
4343
android:name=".auth.AnonymousUpgradeActivity"
44-
android:label="@string/title_anonymous_upgrade"/>
44+
android:label="@string/title_anonymous_upgrade" />
4545

4646
<!-- Firestore demo -->
4747
<activity
@@ -74,4 +74,4 @@
7474

7575
</application>
7676

77-
</manifest>
77+
</manifest>

auth/build.gradle.kts

+4
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,14 @@ dependencies {
7878
implementation(Config.Libs.Androidx.customTabs)
7979
implementation(Config.Libs.Androidx.constraint)
8080
implementation("androidx.credentials:credentials:1.3.0")
81+
implementation("androidx.credentials:credentials-play-services-auth:1.3.0")
8182

8283
implementation(Config.Libs.Androidx.lifecycleExtensions)
8384
implementation("androidx.core:core-ktx:1.13.1")
8485
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0")
86+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3")
87+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3")
88+
implementation("com.google.android.libraries.identity.googleid:googleid:1.1.1")
8589
annotationProcessor(Config.Libs.Androidx.lifecycleCompiler)
8690

8791
implementation(platform(Config.Libs.Firebase.bom))

auth/src/main/AndroidManifest.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<manifest
33
xmlns:android="http://schemas.android.com/apk/res/android"
44
xmlns:tools="http://schemas.android.com/tools"
5-
>
5+
>
66

77
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
88
<uses-permission android:name="android.permission.INTERNET" />
@@ -127,4 +127,4 @@
127127

128128
</application>
129129

130-
</manifest>
130+
</manifest>

auth/src/main/java/com/firebase/ui/auth/KickoffActivity.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ protected void onCreate(@Nullable final Bundle savedInstanceState) {
3636
super.onCreate(savedInstanceState);
3737
mKickstarter = new ViewModelProvider(this).get(SignInKickstarter.class);
3838
mKickstarter.init(getFlowParams());
39-
mKickstarter.getOperation().observe(this, new ResourceObserver<IdpResponse>(this) {
39+
mKickstarter.getOperation().observe(this, new ResourceObserver<>(this) {
4040
@Override
4141
protected void onSuccess(@NonNull IdpResponse response) {
4242
finish(RESULT_OK, response.toIntent());

auth/src/main/java/com/firebase/ui/auth/data/model/PendingIntentRequiredException.java

+36-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.firebase.ui.auth.data.model;
22

33
import android.app.PendingIntent;
4+
import android.content.IntentSender;
45

56
import com.firebase.ui.auth.ErrorCodes;
67
import com.firebase.ui.auth.FirebaseUiException;
@@ -11,19 +12,53 @@
1112
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
1213
public class PendingIntentRequiredException extends FirebaseUiException {
1314
private final PendingIntent mPendingIntent;
15+
private final IntentSender mIntentSender;
1416
private final int mRequestCode;
1517

18+
/**
19+
* Constructor for cases when a PendingIntent is available.
20+
*
21+
* @param pendingIntent The PendingIntent required to complete the operation.
22+
* @param requestCode The associated request code.
23+
*/
1624
public PendingIntentRequiredException(@NonNull PendingIntent pendingIntent, int requestCode) {
1725
super(ErrorCodes.UNKNOWN_ERROR);
1826
mPendingIntent = pendingIntent;
27+
mIntentSender = null;
1928
mRequestCode = requestCode;
2029
}
2130

22-
@NonNull
31+
/**
32+
* Constructor for cases when an IntentSender is available.
33+
*
34+
* @param intentSender The IntentSender required to complete the operation.
35+
* @param requestCode The associated request code.
36+
*/
37+
public PendingIntentRequiredException(@NonNull IntentSender intentSender, int requestCode) {
38+
super(ErrorCodes.UNKNOWN_ERROR);
39+
mIntentSender = intentSender;
40+
mPendingIntent = null;
41+
mRequestCode = requestCode;
42+
}
43+
44+
/**
45+
* Returns the PendingIntent, if available.
46+
*
47+
* @return The PendingIntent or null if not available.
48+
*/
2349
public PendingIntent getPendingIntent() {
2450
return mPendingIntent;
2551
}
2652

53+
/**
54+
* Returns the IntentSender, if available.
55+
*
56+
* @return The IntentSender or null if not available.
57+
*/
58+
public IntentSender getIntentSender() {
59+
return mIntentSender;
60+
}
61+
2762
public int getRequestCode() {
2863
return mRequestCode;
2964
}

auth/src/main/java/com/firebase/ui/auth/data/remote/SignInKickstarter.java

-203
This file was deleted.

0 commit comments

Comments
 (0)