extending token validity on markdown endpoint

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2025-10-14 14:09:59 +02:00
parent 45beedc56d
commit 2d891d555b

View File

@@ -28,8 +28,7 @@ public class MarkdownApi extends BaseHandler implements MarkdownService {
public boolean doPost(Path path, HttpExchange ex) throws IOException {
try {
addCors(ex);
Optional<Token> token = SessionToken.from(ex).map(Token::of);
var user = userService().loadUser(token);
var user = userService().refreshSession(ex);
if (user.isEmpty()) throw UmbrellaException.forbidden("You must be logged in to use the markdown renderer!");
var rendered = Util.markdown(body(ex));