When creating a new credential assign the user's email
This commit is contained in:
parent
ff169ae806
commit
4c60b2bb06
|
@ -30,6 +30,8 @@ public class CredentialBuilder extends Builder<Credential> {
|
||||||
|
|
||||||
private String externalId;
|
private String externalId;
|
||||||
|
|
||||||
|
private String email;
|
||||||
|
|
||||||
public CredentialBuilder id(UUID id) {
|
public CredentialBuilder id(UUID id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
return this;
|
return this;
|
||||||
|
@ -75,6 +77,11 @@ public class CredentialBuilder extends Builder<Credential> {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CredentialBuilder email(String email) {
|
||||||
|
this.email = email;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public Credential build() {
|
public Credential build() {
|
||||||
Credential credential = new Credential();
|
Credential credential = new Credential();
|
||||||
credential.setStatus(status);
|
credential.setStatus(status);
|
||||||
|
@ -86,6 +93,7 @@ public class CredentialBuilder extends Builder<Credential> {
|
||||||
credential.setUserInfo(userInfo);
|
credential.setUserInfo(userInfo);
|
||||||
credential.setId(id);
|
credential.setId(id);
|
||||||
credential.setExternalId(externalId);
|
credential.setExternalId(externalId);
|
||||||
|
credential.setEmail(email);
|
||||||
return credential;
|
return credential;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -135,6 +135,7 @@ public abstract class AbstractAuthenticationService implements AuthenticationSer
|
||||||
.provider(profile.getProvider().getValue())
|
.provider(profile.getProvider().getValue())
|
||||||
.secret(profile.getSecret())
|
.secret(profile.getSecret())
|
||||||
.externalId(profile.getId())
|
.externalId(profile.getId())
|
||||||
|
.email(profile.getEmail())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
if (userInfo == null) {
|
if (userInfo == null) {
|
||||||
|
@ -188,6 +189,7 @@ public abstract class AbstractAuthenticationService implements AuthenticationSer
|
||||||
credential.setUserInfo(userInfo);
|
credential.setUserInfo(userInfo);
|
||||||
credential.setId(UUID.randomUUID());
|
credential.setId(UUID.randomUUID());
|
||||||
credential.setPublicValue(userInfo.getName());
|
credential.setPublicValue(userInfo.getName());
|
||||||
|
credential.setEmail(userInfo.getEmail());
|
||||||
apiContext.getOperationsContext().getDatabaseRepository().getCredentialDao().createOrUpdate(credential);
|
apiContext.getOperationsContext().getDatabaseRepository().getCredentialDao().createOrUpdate(credential);
|
||||||
userInfo.getCredentials().add(credential);
|
userInfo.getCredentials().add(credential);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ import java.util.UUID;
|
||||||
public class UserMergeRequestModel {
|
public class UserMergeRequestModel {
|
||||||
private UUID userId;
|
private UUID userId;
|
||||||
private String email;
|
private String email;
|
||||||
|
private Integer provider;
|
||||||
public UUID getUserId() {
|
public UUID getUserId() {
|
||||||
return userId;
|
return userId;
|
||||||
}
|
}
|
||||||
|
@ -18,4 +19,11 @@ public class UserMergeRequestModel {
|
||||||
this.email = email;
|
this.email = email;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer getProvider() {
|
||||||
|
return provider;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProvider(Integer provider) {
|
||||||
|
this.provider = provider;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue