Multi-user servers: email and invite codes at sign-up and sign-in
Create account takes an email and an invite or setup code (none with open sign-up), joins servers that already have accounts, and Settings shows the account email (admins manage people from the web vault). Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -154,17 +154,18 @@ fn state(app: State<'_, App>) -> AppState {
|
||||
|
||||
// Argon2id takes ~0.5 s, so these run as async commands off the main thread.
|
||||
|
||||
/// "Create a new account": a new vault here, registered with a fresh server using its setup code.
|
||||
/// "Create a new account": a new vault here, registered with the server using its setup code or an invite.
|
||||
#[tauri::command]
|
||||
async fn create_account(
|
||||
app: State<'_, App>,
|
||||
server_url: String,
|
||||
pins: String,
|
||||
setup_code: String,
|
||||
email: String,
|
||||
master_password: String,
|
||||
) -> CmdResult<String> {
|
||||
let master_password = Zeroizing::new(master_password);
|
||||
let sk = app.sync.create_account(&server_url, sync::parse_pins(&pins), &setup_code, master_password).await;
|
||||
let sk = app.sync.create_account(&server_url, sync::parse_pins(&pins), &setup_code, &email, master_password).await;
|
||||
app.activity.touch();
|
||||
sk.map(|s| s.to_string())
|
||||
}
|
||||
@@ -378,8 +379,8 @@ async fn server_setup_open(app: State<'_, App>) -> CmdResult<bool> {
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
async fn register_server(app: State<'_, App>, setup_code: String) -> CmdResult<()> {
|
||||
app.sync.register(&setup_code).await
|
||||
async fn register_server(app: State<'_, App>, setup_code: String, email: String) -> CmdResult<()> {
|
||||
app.sync.register(&setup_code, &email).await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
|
||||
Reference in New Issue
Block a user