Merge branch 'main' into lang_de

This commit is contained in:
2024-05-19 12:15:33 +00:00
4 changed files with 15 additions and 7 deletions

View File

@@ -372,14 +372,17 @@ public class Web extends TemplateServlet {
case RESET_PASSWORD:
if (!isGet) return resetPassword(req,resp);
// TODO: move following code into resetPassword method
try {
user = User.byToken(req.getParameter(TOKEN));
if (user != null) {
var token = req.getParameter(TOKEN);
if (token != null){
try {
user = User.byToken(req.getParameter(TOKEN));
if (user == null) return loadTemplate(path,Map.of(ERROR,t("Failed to find user for token!")),resp);
user.dropPasswordToken();
req.getSession().setAttribute("user",user);
return redirectTo(NEW_PASSWORD_FORM,resp);
} catch (SQLException sqle){
return loadTemplate(path,Map.of(ERROR,t("Failed to add user for token!")),resp);
}
} catch (SQLException sqle){
return loadTemplate(path,Map.of(ERROR,t("Failed to find user for token!")),resp);
}
var email = req.getParameter(EMAIL);
return loadTemplate(path,email == null ? null : Map.of(EMAIL,email),resp);