extending token validity on markdown endpoint
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user