web ui: New setting for browser-based login

This is useful in cases where OIDC login is active
which would then redirect the user to a central
login page.

See https://github.com/Kozea/Radicale/issues/2143
This commit is contained in:
Max Berger
2026-05-27 19:36:05 +02:00
parent 10983fc924
commit 19f9d0a8c7
7 changed files with 51 additions and 6 deletions

View File

@@ -0,0 +1,3 @@
// This file is dynamically overwritten during serving. The contents here are just to enable development an testing.
export const PREFER_BROWSER_LOGIN = false;

View File

@@ -20,6 +20,7 @@
*/
import { get_principal } from "../api/api.js";
import { PREFER_BROWSER_LOGIN } from "../config.js";
import { ROOT_PATH, SERVER } from "../constants.js";
import { Collection } from "../models/collection.js";
import { extract_title, extractUsernameFromPrincipalCollection } from "../utils/collection_utils.js";
@@ -167,7 +168,7 @@ export class LoginScene {
fetch(SERVER + ROOT_PATH, {
method: 'PROPFIND',
headers: { 'Depth': '0' },
credentials: 'omit'
credentials: PREFER_BROWSER_LOGIN ? 'include' : 'omit'
}).then((response) => {
if (response.ok) {
// Authenticated! Now it's safe to call get_principal