Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions bookmarks/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@
},
}

# Allow override of the session cookie length, provided in seconds.
SESSION_COOKIE_AGE = int(os.getenv("LD_SESSION_COOKIE_AGE", 1209600)) # 2 weeks

# Disable login form if configured
LD_DISABLE_LOGIN_FORM = os.getenv("LD_DISABLE_LOGIN_FORM", False) in (
True,
Expand Down
13 changes: 12 additions & 1 deletion bookmarks/templates/bookmarks/form.html
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,19 @@

// Fetch website metadata when page loads and when URL changes, unless we are editing an existing bookmark
if (!editedBookmarkId) {
function debounce(callback, delay = 500) {
let timeoutId;
return (...args) => {
clearTimeout(timeoutId);
timeoutId = setTimeout(() => {
timeoutId = null;
callback(...args);
}, delay);
};
}

checkUrl();
urlInput.addEventListener('input', checkUrl);
urlInput.addEventListener('input', debounce(checkUrl));
titleInput.addEventListener('input', () => {
isTitleModified = true;
});
Expand Down
6 changes: 6 additions & 0 deletions docs/src/content/docs/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,12 @@ Disables the login form on the login page.
This is useful when you want to enforce authentication through OIDC only.
When enabled, users will not be able to log in using their username and password, and only the "Login with OIDC" button will be shown on the login page.

### `LD_SESSION_COOKIE_AGE`

Values: `Integer` as seconds | Default = `1209600`

Set the lifetime of the session cookie, in seconds. This value determines how long a browser will stay logged in to the web interface. The default value is 2 weeks.

### `LD_CSRF_TRUSTED_ORIGINS`

Values: `String` | Default = None
Expand Down
Loading