Merge "OAuthRealm should not overwrite custom AuthRequest parameters"
This commit is contained in:
@@ -103,10 +103,14 @@ public class OAuthRealm extends AbstractRealm {
|
|||||||
if (userInfo == null) {
|
if (userInfo == null) {
|
||||||
throw new AccountException("Cannot authenticate");
|
throw new AccountException("Cannot authenticate");
|
||||||
}
|
}
|
||||||
if (!Strings.isNullOrEmpty(userInfo.getEmailAddress())) {
|
if (!Strings.isNullOrEmpty(userInfo.getEmailAddress())
|
||||||
|
&& (Strings.isNullOrEmpty(who.getUserName())
|
||||||
|
|| !allowsEdit(FieldName.REGISTER_NEW_EMAIL))) {
|
||||||
who.setEmailAddress(userInfo.getEmailAddress());
|
who.setEmailAddress(userInfo.getEmailAddress());
|
||||||
}
|
}
|
||||||
if (!Strings.isNullOrEmpty(userInfo.getDisplayName())) {
|
if (!Strings.isNullOrEmpty(userInfo.getDisplayName())
|
||||||
|
&& (Strings.isNullOrEmpty(who.getDisplayName())
|
||||||
|
|| !allowsEdit(FieldName.FULL_NAME))) {
|
||||||
who.setDisplayName(userInfo.getDisplayName());
|
who.setDisplayName(userInfo.getDisplayName());
|
||||||
}
|
}
|
||||||
return who;
|
return who;
|
||||||
|
Reference in New Issue
Block a user