feat: add desktop UI password setting
Adds optional desktop UI password protection Starts Electron with the saved UI password Explains login session duration in settings
This commit is contained in:
@@ -115,6 +115,9 @@ export const createSettingsHelpers = (dependencies) => {
|
||||
if (typeof candidate.desktopLanAccessEnabled === 'boolean') {
|
||||
result.desktopLanAccessEnabled = candidate.desktopLanAccessEnabled;
|
||||
}
|
||||
if (typeof candidate.desktopUiPassword === 'string') {
|
||||
result.desktopUiPassword = candidate.desktopUiPassword.trim();
|
||||
}
|
||||
if (Array.isArray(candidate.projects)) {
|
||||
const projects = sanitizeProjects(candidate.projects);
|
||||
if (projects) {
|
||||
|
||||
@@ -52,6 +52,17 @@ describe('settings helpers', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('accepts desktopUiPassword as a persisted shared setting', () => {
|
||||
const helpers = createTestHelpers();
|
||||
|
||||
expect(helpers.sanitizeSettingsUpdate({ desktopUiPassword: ' secret ' })).toEqual({
|
||||
desktopUiPassword: 'secret',
|
||||
});
|
||||
expect(helpers.sanitizeSettingsUpdate({ desktopUiPassword: '' })).toEqual({
|
||||
desktopUiPassword: '',
|
||||
});
|
||||
});
|
||||
|
||||
it('accepts mobileKeyboardMode as a persisted shared setting', () => {
|
||||
const helpers = createTestHelpers();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user