this.newCredentials.setUser(result.getAuthenticatedId());
this.newCredentials.setEmail(result.getEmail());
// NB: Seam component injection won't work on callbacks
EntityManager em =
ServiceLocator.instance().getEntityManager();
CredentialsDAO credentialsDAO =
ServiceLocator.instance().getInstance(
CredentialsDAO.class);
Conversation.instance().begin(true, false); // (To retain
// messages)
FacesMessages.instance().clear();
if (credentialsDAO.findByUser(result.getAuthenticatedId()) != null) {
FacesMessages.instance().add(ERROR,
"jsf.identities.invalid.Duplicate", null,
"Duplicate identity",
"This Identity is already in use.");
} else {