Spiegel von
https://github.com/dani-garcia/vaultwarden.git
synchronisiert 2024-11-16 04:12:53 +01:00
Merge pull request #864 from mprasil/admin-invitation
Do not disable invitations via admin API
Dieser Commit ist enthalten in:
Commit
c5b97f4146
2 geänderte Dateien mit 4 neuen und 9 gelöschten Zeilen
|
@ -153,10 +153,6 @@ fn invite_user(data: Json<InviteData>, _token: AdminToken, conn: DbConn) -> Empt
|
||||||
err!("User already exists")
|
err!("User already exists")
|
||||||
}
|
}
|
||||||
|
|
||||||
if !CONFIG.invitations_allowed() {
|
|
||||||
err!("Invitations are not allowed")
|
|
||||||
}
|
|
||||||
|
|
||||||
let mut user = User::new(email);
|
let mut user = User::new(email);
|
||||||
user.save(&conn)?;
|
user.save(&conn)?;
|
||||||
|
|
||||||
|
|
|
@ -319,10 +319,9 @@ impl Invitation {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn take(mail: &str, conn: &DbConn) -> bool {
|
pub fn take(mail: &str, conn: &DbConn) -> bool {
|
||||||
CONFIG.invitations_allowed()
|
match Self::find_by_mail(mail, &conn) {
|
||||||
&& match Self::find_by_mail(mail, &conn) {
|
Some(invitation) => invitation.delete(&conn).is_ok(),
|
||||||
Some(invitation) => invitation.delete(&conn).is_ok(),
|
None => false,
|
||||||
None => false,
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Laden …
In neuem Issue referenzieren