feat(username|email): pass1: normalize auth.user data

username: now optional, if defined 2..64 chars
    password: now optional (no mode __NO_PASSWORD...__)
    oidc: now optional

    important: if need Nextcloud, username must be defined
This commit is contained in:
Edouard Vanbelle
2026-06-02 21:21:24 +02:00
parent 37b1c2703b
commit d57a50d056
17 changed files with 418 additions and 247 deletions
+14 -7
View File
@@ -271,19 +271,26 @@ pub async fn handle_sharees_search(
.await
.unwrap_or_default();
// Skip users with no claimed username — NC sharees autocomplete relies
// on a username being typeable; users still on the email-only signup
// path can't be addressed here. Also skip self (don't suggest sharing
// with yourself).
let matches: Vec<serde_json::Value> = users
.into_iter()
.filter(|u| u.username != user.username) // Don't suggest self
.take(25)
.map(|u| {
json!({
"label": u.username,
.filter_map(|u| {
let handle = u.username.clone()?;
if handle == user.username {
return None;
}
Some(json!({
"label": handle,
"value": {
"shareType": 0,
"shareWith": u.username
"shareWith": handle,
}
})
}))
})
.take(25)
.collect();
sharees_response(matches).into_response()