handle OSS onboarding error gracefully (#8459)

* fix: handle OSS onboarding error gracefully in setup wizard

When creating a custom admin account fails on OSS builds (Enterprise-only
feature), show a helpful dialog instead of a generic error, guiding the
user to continue with default credentials.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: use more precise error check for OSS account creation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: correct error message — not an EE feature, just not implemented in OSS

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: remove misleading "change from user settings" since set_password is also OSS-stubbed

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: move default credentials info to frontend dialog only

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
centdix
2026-03-20 12:37:05 +00:00
committed by GitHub
co-authored by Claude Opus 4.6
parent 88ad376791
commit 533609989f
2 changed files with 44 additions and 2 deletions
+1 -1
View File
@@ -38,7 +38,7 @@ pub async fn create_user(
mut _nu: NewUser,
) -> Result<(StatusCode, String)> {
Err(Error::internal_err(
"Not implemented in Windmill's Open Source repository".to_string(),
"User creation is not implemented in the open-source version.".to_string(),
))
}
@@ -84,6 +84,8 @@
let enableHubSync = $state(true)
let accountSubmitting = $state(false)
let accountError = $state('')
let showOssAccountDialog = $state(false)
let ossAccountError = $state('')
// --- Resource type sync (triggered on entering account step) ---
let rtSyncStatus: 'idle' | 'loading' | 'success' | 'error' = $state('idle')
@@ -316,7 +318,13 @@
)
)
} catch (e: any) {
accountError = e?.body?.message || e?.body || e?.message || 'An error occurred'
const msg = e?.body?.message || e?.body || e?.message || 'An error occurred'
if (typeof msg === 'string' && msg.includes('User creation is not implemented in the open-source version')) {
ossAccountError = msg
showOssAccountDialog = true
} else {
accountError = msg
}
} finally {
accountSubmitting = false
}
@@ -639,3 +647,37 @@
</div>
</ConfirmationModal>
{/if}
{#if showOssAccountDialog}
<ConfirmationModal
open={showOssAccountDialog}
title="Not available in open-source"
confirmationText="Continue with default credentials"
on:canceled={() => {
showOssAccountDialog = false
}}
on:confirmed={() => {
showOssAccountDialog = false
sendUserToast('Setup complete. Please log in with the default credentials.')
goto(
'/user/logout?rd=' +
encodeURIComponent(
'/user/login?email=' +
encodeURIComponent('admin@windmill.dev') +
'&password=' +
encodeURIComponent('changeme')
)
)
}}
>
<div class="flex flex-col w-full space-y-4">
<Alert type="error" title="Backend error">
{ossAccountError}
</Alert>
<span>
Click "Continue" to finish setup and log in with the default credentials
(admin@windmill.dev / changeme).
</span>
</div>
</ConfirmationModal>
{/if}