Skip to content

Commit

Permalink
feat: remove email enumeration (#2184)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyokone authored Feb 27, 2025
1 parent 0b40f22 commit e004565
Show file tree
Hide file tree
Showing 28 changed files with 1,104 additions and 1,019 deletions.
6 changes: 3 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
>
>

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
Expand Down Expand Up @@ -41,7 +41,7 @@
android:label="@string/title_auth_activity" />
<activity
android:name=".auth.AnonymousUpgradeActivity"
android:label="@string/title_anonymous_upgrade"/>
android:label="@string/title_anonymous_upgrade" />

<!-- Firestore demo -->
<activity
Expand Down Expand Up @@ -74,4 +74,4 @@

</application>

</manifest>
</manifest>
4 changes: 4 additions & 0 deletions auth/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,14 @@ dependencies {
implementation(Config.Libs.Androidx.customTabs)
implementation(Config.Libs.Androidx.constraint)
implementation("androidx.credentials:credentials:1.3.0")
implementation("androidx.credentials:credentials-play-services-auth:1.3.0")

implementation(Config.Libs.Androidx.lifecycleExtensions)
implementation("androidx.core:core-ktx:1.13.1")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3")
implementation("com.google.android.libraries.identity.googleid:googleid:1.1.1")
annotationProcessor(Config.Libs.Androidx.lifecycleCompiler)

implementation(platform(Config.Libs.Firebase.bom))
Expand Down
4 changes: 2 additions & 2 deletions auth/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
>
>

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
Expand Down Expand Up @@ -127,4 +127,4 @@

</application>

</manifest>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ protected void onCreate(@Nullable final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mKickstarter = new ViewModelProvider(this).get(SignInKickstarter.class);
mKickstarter.init(getFlowParams());
mKickstarter.getOperation().observe(this, new ResourceObserver<IdpResponse>(this) {
mKickstarter.getOperation().observe(this, new ResourceObserver<>(this) {
@Override
protected void onSuccess(@NonNull IdpResponse response) {
finish(RESULT_OK, response.toIntent());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.firebase.ui.auth.data.model;

import android.app.PendingIntent;
import android.content.IntentSender;

import com.firebase.ui.auth.ErrorCodes;
import com.firebase.ui.auth.FirebaseUiException;
Expand All @@ -11,19 +12,53 @@
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public class PendingIntentRequiredException extends FirebaseUiException {
private final PendingIntent mPendingIntent;
private final IntentSender mIntentSender;
private final int mRequestCode;

/**
* Constructor for cases when a PendingIntent is available.
*
* @param pendingIntent The PendingIntent required to complete the operation.
* @param requestCode The associated request code.
*/
public PendingIntentRequiredException(@NonNull PendingIntent pendingIntent, int requestCode) {
super(ErrorCodes.UNKNOWN_ERROR);
mPendingIntent = pendingIntent;
mIntentSender = null;
mRequestCode = requestCode;
}

@NonNull
/**
* Constructor for cases when an IntentSender is available.
*
* @param intentSender The IntentSender required to complete the operation.
* @param requestCode The associated request code.
*/
public PendingIntentRequiredException(@NonNull IntentSender intentSender, int requestCode) {
super(ErrorCodes.UNKNOWN_ERROR);
mIntentSender = intentSender;
mPendingIntent = null;
mRequestCode = requestCode;
}

/**
* Returns the PendingIntent, if available.
*
* @return The PendingIntent or null if not available.
*/
public PendingIntent getPendingIntent() {
return mPendingIntent;
}

/**
* Returns the IntentSender, if available.
*
* @return The IntentSender or null if not available.
*/
public IntentSender getIntentSender() {
return mIntentSender;
}

public int getRequestCode() {
return mRequestCode;
}
Expand Down

This file was deleted.

Loading

0 comments on commit e004565

Please sign in to comment.