diff --git a/frontend-modern/src/components/Settings/QuickSecuritySetup.tsx b/frontend-modern/src/components/Settings/QuickSecuritySetup.tsx index 8d4aad598..350208e7f 100644 --- a/frontend-modern/src/components/Settings/QuickSecuritySetup.tsx +++ b/frontend-modern/src/components/Settings/QuickSecuritySetup.tsx @@ -65,9 +65,21 @@ export const QuickSecuritySetup: Component = () => { throw new Error(error || 'Failed to setup security'); } + const result = await response.json(); setCredentials(newCredentials); setShowCredentials(true); - showSuccess('Security enabled successfully!'); + + if (result.method === 'systemd' && result.willRestart) { + showSuccess('Security enabled! Pulse will restart automatically in 2 seconds...'); + // Show countdown + setTimeout(() => { + showSuccess('Restarting now... You will need to log in with your new credentials.'); + }, 2000); + } else if (result.method === 'docker') { + showSuccess('Security configured! Please restart your Docker container with the credentials shown.'); + } else { + showSuccess('Security configured! Please restart Pulse to apply settings.'); + } } catch (error) { showError(`Failed to setup security: ${error}`); } finally { @@ -238,36 +250,13 @@ Important: -
- To activate these credentials: +
+ ✅ Security has been automatically enabled! +
++ Pulse will restart automatically in a few seconds. You'll need to log in with these credentials.
-For systemd (most common):
-
-sudo systemctl edit pulse-backend
-
-# Add these lines:
-[Service]
-Environment="PULSE_AUTH_USER={credentials()!.username}"
-Environment="PULSE_AUTH_PASS={credentials()!.password}"
-Environment="API_TOKEN={credentials()!.apiToken}"
-
-# Save and exit, then:
-sudo systemctl restart pulse-backend
- For Docker:
-
-docker run -d \
- -e PULSE_AUTH_USER={credentials()!.username} \
- -e PULSE_AUTH_PASS={credentials()!.password} \
- -e API_TOKEN={credentials()!.apiToken} \
- rcourtman/pulse:latest
-