mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-20 08:01:35 +00:00
533609989f
* 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>
83 lines
2.0 KiB
Rust
83 lines
2.0 KiB
Rust
#[cfg(feature = "private")]
|
|
#[allow(unused)]
|
|
pub use crate::users_ee::*;
|
|
|
|
#[cfg(not(feature = "private"))]
|
|
use std::sync::Arc;
|
|
|
|
#[cfg(not(feature = "private"))]
|
|
use crate::db::ApiAuthed;
|
|
|
|
#[cfg(not(feature = "private"))]
|
|
use crate::users::{EditPassword, NewUser};
|
|
|
|
#[cfg(not(feature = "private"))]
|
|
use crate::{db::DB, webhook_util::WebhookShared};
|
|
|
|
#[cfg(not(feature = "private"))]
|
|
use argon2::Argon2;
|
|
|
|
#[cfg(not(feature = "private"))]
|
|
use axum::{extract::Extension, Json};
|
|
|
|
#[cfg(not(feature = "private"))]
|
|
use http::StatusCode;
|
|
|
|
#[cfg(not(feature = "private"))]
|
|
use serde::Deserialize;
|
|
|
|
#[cfg(not(feature = "private"))]
|
|
use windmill_common::error::{Error, Result};
|
|
|
|
#[cfg(not(feature = "private"))]
|
|
pub async fn create_user(
|
|
_authed: ApiAuthed,
|
|
_db: DB,
|
|
_webhook: WebhookShared,
|
|
_argon2: Arc<Argon2<'_>>,
|
|
mut _nu: NewUser,
|
|
) -> Result<(StatusCode, String)> {
|
|
Err(Error::internal_err(
|
|
"User creation is not implemented in the open-source version.".to_string(),
|
|
))
|
|
}
|
|
|
|
#[cfg(not(feature = "private"))]
|
|
pub async fn set_password(
|
|
_db: DB,
|
|
_argon2: Arc<Argon2<'_>>,
|
|
_authed: ApiAuthed,
|
|
_user_email: &str,
|
|
_ep: EditPassword,
|
|
) -> Result<String> {
|
|
Err(Error::internal_err(
|
|
"Not implemented in Windmill's Open Source repository".to_string(),
|
|
))
|
|
}
|
|
|
|
#[cfg(not(feature = "private"))]
|
|
pub fn hash_password(_argon2: Arc<Argon2<'_>>, _password: String) -> Result<String> {
|
|
Err(Error::internal_err(
|
|
"Not implemented in Windmill's Open Source repository".to_string(),
|
|
))
|
|
}
|
|
|
|
#[cfg(not(feature = "private"))]
|
|
#[derive(Deserialize, Debug)]
|
|
#[allow(dead_code)]
|
|
pub struct OnboardingData {
|
|
pub touch_point: String,
|
|
pub use_case: String,
|
|
}
|
|
|
|
#[cfg(not(feature = "private"))]
|
|
pub async fn submit_onboarding_data(
|
|
_authed: ApiAuthed,
|
|
Extension(_db): Extension<DB>,
|
|
Json(_data): Json<OnboardingData>,
|
|
) -> Result<String> {
|
|
Err(Error::internal_err(
|
|
"Not implemented in Windmill's Open Source repository".to_string(),
|
|
))
|
|
}
|