updated mail properties

This commit is contained in:
harish
2024-10-20 15:26:43 +05:30
parent b7580deca7
commit ca2a7c5ccf
6 changed files with 42 additions and 8 deletions

View File

@@ -17,11 +17,13 @@ import net.gepafin.tendermanagement.web.rest.api.errors.Status;
import net.gepafin.tendermanagement.web.rest.api.errors.UnauthorizedAccessException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Component;
import java.util.Arrays;
import java.util.Map;
@Component
@@ -38,6 +40,9 @@ public class Validator {
@Autowired
private CallService callService;
@Autowired
private Environment environment;
public Map<String, Object> getUserInfoFromToken(HttpServletRequest request) {
return tokenProvider.getUserInfoAndUserIdFromToken(request);
@@ -114,6 +119,9 @@ public class Validator {
return callEntity;
}
public Boolean isProductionProfileActivated() {
String[] activeProfiles = environment.getActiveProfiles();
return Arrays.stream(activeProfiles).anyMatch("production"::equals);
}
}