Skip to content

Commit d4f7627

Browse files
committed
fix(tfa): save TFA configuration parameters and update SQL insert values
1 parent 6050c9f commit d4f7627

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

backend/src/main/java/com/park/utmstack/service/UtmConfigurationParameterService.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,12 @@ public List<UtmConfigurationParameter> getConfigParameterBySectionId(long sectio
172172
}
173173
}
174174

175+
176+
public void saveAllConfigParams(List<UtmConfigurationParameter> params) {
177+
final String ctx = CLASSNAME + ".saveAllConfigParams";
178+
configParamRepository.saveAll(params);
179+
}
180+
175181
public void validateMailConfOnMFAActivation() throws UtmMailException {
176182
final String ctx = CLASSNAME + ".validateMailConfOnMFAActivation";
177183
try {

backend/src/main/java/com/park/utmstack/web/rest/tfa/TfaController.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public ResponseEntity<Void> completeTfa(@RequestBody TfaSaveRequest request) {
8787
final String ctx = CLASSNAME + ".completeTfa";
8888
try {
8989

90-
/*List<UtmConfigurationParameter> tfaParams = utmConfigurationParameterService.getConfigParameterBySectionId(Constants.TFA_SETTING_ID);
90+
List<UtmConfigurationParameter> tfaParams = utmConfigurationParameterService.getConfigParameterBySectionId(Constants.TFA_SETTING_ID);
9191

9292
for (UtmConfigurationParameter param : tfaParams) {
9393
switch (param.getConfParamShort()) {
@@ -98,12 +98,15 @@ public ResponseEntity<Void> completeTfa(@RequestBody TfaSaveRequest request) {
9898
param.setConfParamValue(String.valueOf(request.isEnable()));
9999
break;
100100
}
101-
}*/
101+
}
102+
103+
102104

103105

104106

105107
tfaService.persistConfiguration(request.getMethod());
106108
User user = userService.getCurrentUserLogin();
109+
utmConfigurationParameterService.saveAllConfigParams(tfaParams);
107110
tfaService.generateChallenge(user);
108111
return ResponseEntity.ok().build();
109112
} catch (UtmMailException e) {

backend/src/main/resources/config/liquibase/data/utm_group_rules_data_type.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -513,8 +513,8 @@ INSERT INTO public.utm_group_rules_data_type VALUES (1501, 1, NULL);
513513
INSERT INTO public.utm_group_rules_data_type VALUES (1502, 1, NULL);
514514
INSERT INTO public.utm_group_rules_data_type VALUES (1503, 1, NULL);
515515
INSERT INTO public.utm_group_rules_data_type VALUES (1504, 1, NULL);
516-
INSERT INTO public.utm_group_rules_data_type VALUES (1220, 5004, NULL);
517-
INSERT INTO public.utm_group_rules_data_type VALUES (1219, 5004, NULL);
516+
INSERT INTO public.utm_group_rules_data_type VALUES (1220, 49, NULL);
517+
INSERT INTO public.utm_group_rules_data_type VALUES (1219, 49, NULL);
518518
INSERT INTO public.utm_group_rules_data_type VALUES (212, 13, NULL);
519519
INSERT INTO public.utm_group_rules_data_type VALUES (213, 13, NULL);
520520
INSERT INTO public.utm_group_rules_data_type VALUES (214, 13, NULL);

0 commit comments

Comments
 (0)