Skip to content

Commit 3aa9175

Browse files
authored
Merge pull request #595 from SUPERCILEX/miscellaneous-improvements
Lock IdpConfigs and scopes
2 parents e370fb3 + e56d9ef commit 3aa9175

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

.idea/codeStyleSettings.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,13 +316,13 @@ public static class IdpConfig implements Parcelable {
316316
private final List<String> mScopes;
317317

318318
private IdpConfig(@NonNull String providerId, List<String> scopes) {
319-
mScopes = scopes;
320319
mProviderId = providerId;
320+
mScopes = Collections.unmodifiableList(scopes);
321321
}
322322

323323
private IdpConfig(Parcel in) {
324324
mProviderId = in.readString();
325-
mScopes = in.createStringArrayList();
325+
mScopes = Collections.unmodifiableList(in.createStringArrayList());
326326
}
327327

328328
public String getProviderId() {

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import com.firebase.ui.auth.AuthUI.IdpConfig;
2525
import com.firebase.ui.auth.util.Preconditions;
2626

27+
import java.util.Collections;
2728
import java.util.List;
2829

2930
/**
@@ -60,7 +61,8 @@ public FlowParameters(
6061
boolean smartLockEnabled,
6162
boolean allowNewEmailAccounts) {
6263
this.appName = Preconditions.checkNotNull(appName, "appName cannot be null");
63-
this.providerInfo = Preconditions.checkNotNull(providerInfo, "providerInfo cannot be null");
64+
this.providerInfo = Collections.unmodifiableList(
65+
Preconditions.checkNotNull(providerInfo, "providerInfo cannot be null"));
6466
this.themeId = themeId;
6567
this.logoId = logoId;
6668
this.termsOfServiceUrl = termsOfServiceUrl;
@@ -92,11 +94,8 @@ public FlowParameters createFromParcel(Parcel in) {
9294
int themeId = in.readInt();
9395
int logoId = in.readInt();
9496
String termsOfServiceUrl = in.readString();
95-
int smartLockEnabledInt = in.readInt();
96-
int allowNewEmailAccountsInt = in.readInt();
97-
98-
boolean smartLockEnabled = smartLockEnabledInt != 0;
99-
boolean allowNewEmailAccounts = allowNewEmailAccountsInt != 0;
97+
boolean smartLockEnabled = in.readInt() != 0;
98+
boolean allowNewEmailAccounts = in.readInt() != 0;
10099

101100
return new FlowParameters(
102101
appName,

0 commit comments

Comments
 (0)