fix token removal, improve system properties, add pretix request warnings
This commit is contained in:
parent
4b819f1d08
commit
1488a3b8b7
@ -525,11 +525,15 @@ public class PretixManager implements SmartInitializingSingleton {
|
||||
if (payload != null) {
|
||||
request.bodyValue(gson.toJson(payload));
|
||||
}
|
||||
try {
|
||||
String jsonString = request.retrieve().bodyToMono(String.class).block();
|
||||
|
||||
String jsonString = request.retrieve().bodyToMono(String.class).block();
|
||||
|
||||
if (StringUtils.hasText(jsonString)) {
|
||||
return JsonParser.parseString(jsonString);
|
||||
if (StringUtils.hasText(jsonString)) {
|
||||
return JsonParser.parseString(jsonString);
|
||||
}
|
||||
} catch (WebClientResponseException e) {
|
||||
logger.warn("Error response: " + e.getResponseBodyAsString(), e);
|
||||
throw e;
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -20,6 +20,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.beust.jcommander.internal.Lists;
|
||||
|
||||
import de.bstly.we.businesslogic.PretixManager;
|
||||
import de.bstly.we.controller.support.EntityResponseStatusException;
|
||||
import de.bstly.we.model.SystemProperty;
|
||||
@ -90,6 +92,17 @@ public class SystemController extends BaseController {
|
||||
return systemPropertyRepository.save(systemProperty);
|
||||
}
|
||||
|
||||
@PreAuthorize("hasRole('ROLE_ADMIN')")
|
||||
@PostMapping("/properties/list")
|
||||
public List<SystemProperty> createOrUpdateList(@RequestBody List<SystemProperty> systemProperties) {
|
||||
List<SystemProperty> result = Lists.newArrayList();
|
||||
for (SystemProperty systemProperty : systemProperties) {
|
||||
result.add(
|
||||
systemPropertyRepository.save(systemProperty));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete property.
|
||||
*
|
||||
|
@ -260,9 +260,9 @@ public class TokenSessionManager {
|
||||
for (String token : ((String) sessionAttribute).split(",")) {
|
||||
if (!token.equals(secret)) {
|
||||
if (StringUtils.hasLength(tokens)) {
|
||||
tokens += "," + secret;
|
||||
tokens += "," + token;
|
||||
} else {
|
||||
tokens = secret;
|
||||
tokens = token;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user