mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-08-02 00:59:08 +00:00
auto-accept existing user if mail is disabled
Apply suggestions from code review Co-authored-by: Mathijs van Veluw <black.dex@gmail.com>
This commit is contained in:
parent
e6392c1b62
commit
3a673d37b7
1 changed files with 6 additions and 1 deletions
|
@ -1030,9 +1030,14 @@ async fn _reinvite_user(org_id: &str, user_org: &str, invited_by_email: &str, co
|
|||
Some(invited_by_email.to_string()),
|
||||
)
|
||||
.await?;
|
||||
} else {
|
||||
} else if user.password_hash.is_empty() {
|
||||
let invitation = Invitation::new(&user.email);
|
||||
invitation.save(conn).await?;
|
||||
} else {
|
||||
let _ = Invitation::take(&user.email, conn).await;
|
||||
let mut user_org = user_org;
|
||||
user_org.status = UserOrgStatus::Accepted as i32;
|
||||
user_org.save(conn).await?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue