From bd205efb24dc823bb511dc80e04d7784cfe8b4a7 Mon Sep 17 00:00:00 2001 From: Daniel Palafox Date: Tue, 31 Oct 2023 16:33:45 -0500 Subject: [PATCH] fix: Add missing togglz for events in social sign in --- .../org/orcid/frontend/web/controllers/LoginController.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/orcid-web/src/main/java/org/orcid/frontend/web/controllers/LoginController.java b/orcid-web/src/main/java/org/orcid/frontend/web/controllers/LoginController.java index 8a2879f99da..dff31541f06 100644 --- a/orcid-web/src/main/java/org/orcid/frontend/web/controllers/LoginController.java +++ b/orcid-web/src/main/java/org/orcid/frontend/web/controllers/LoginController.java @@ -24,6 +24,7 @@ import org.orcid.core.oauth.service.OrcidAuthorizationEndpoint; import org.orcid.core.oauth.service.OrcidOAuth2RequestValidator; import org.orcid.core.security.OrcidUserDetailsService; +import org.orcid.core.togglz.Features; import org.orcid.core.utils.EventType; import org.orcid.frontend.spring.web.social.config.SocialSignInUtils; import org.orcid.frontend.spring.web.social.config.SocialType; @@ -325,7 +326,9 @@ private ModelAndView processSocialLogin(HttpServletRequest request, HttpServletR userConnectionId = userConnection.getId().getUserid(); // Store relevant data in the session socialSignInUtils.setSignedInData(request, userData); - eventManager.createEvent(userConnection.getOrcid(), EventType.SIGN_IN, request, null); + if (Features.EVENTS.isActive()) { + eventManager.createEvent(userConnection.getOrcid(), EventType.SIGN_IN, request, null); + } if(userConnection.isLinked()) { // If user exists and is linked update user connection info