Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit 0fa0847

Browse files
authored
Merge branch 'TriliumNext:develop' into develop
2 parents 22f1fee + 627e90e commit 0fa0847

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

docs/Release Notes/Release Notes/v0.92.8-beta.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
* [Most tree context menu on mobile are broken](https://github.com/TriliumNext/Notes/issues/671)
1313
* [Quick search launch bar item does nothing in vertical layout](https://github.com/TriliumNext/Notes/issues/1680)
1414
* [Note background is gray in 0.92.7 (light theme)](https://github.com/TriliumNext/Notes/issues/1689)
15+
* [config.Session.cookieMaxAge is ignored](https://github.com/TriliumNext/Notes/issues/1709) by @pano9000
16+
* [Return correct HTTP status code on failed login attempts instead of 200](https://github.com/TriliumNext/Notes/issues/1707) by @pano9000
1517

1618
## ✨ Improvements
1719

src/public/app/widgets/type_widgets/ckeditor/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export function buildConfig() {
7474
heading: {
7575
options: [
7676
{ model: "paragraph" as const, title: "Paragraph", class: "ck-heading_paragraph" },
77-
// // heading1 is not used since that should be a note's title
77+
// heading1 is not used since that should be a note's title
7878
{ model: "heading2" as const, view: "h2", title: "Heading 2", class: "ck-heading_heading2" },
7979
{ model: "heading3" as const, view: "h3", title: "Heading 3", class: "ck-heading_heading3" },
8080
{ model: "heading4" as const, view: "h4", title: "Heading 4", class: "ck-heading_heading4" },

src/routes/login.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,10 @@ function login(req: Request, res: Response) {
9292
const rememberMe = req.body.rememberMe;
9393

9494
req.session.regenerate(() => {
95-
if (rememberMe) {
96-
req.session.cookie.maxAge = 21 * 24 * 3600000; // 3 weeks
97-
} else {
95+
if (!rememberMe) {
9896
// unset default maxAge set by sessionParser
99-
// Cookie becomes non-persistent and expires after current browser session (e.g. when browser is closed)
97+
// Cookie becomes non-persistent and expires
98+
// after current browser session (e.g. when browser is closed)
10099
req.session.cookie.maxAge = undefined;
101100
}
102101

@@ -134,7 +133,7 @@ function sendLoginError(req: Request, res: Response, errorType: 'password' | 'to
134133
log.info(`WARNING: Wrong password from ${req.ip}, rejecting.`);
135134
}
136135

137-
res.render('login', {
136+
res.status(401).render('login', {
138137
wrongPassword: errorType === 'password',
139138
wrongTotp: errorType === 'totp',
140139
totpEnabled: totp.isTotpEnabled(),

0 commit comments

Comments
 (0)