vw_small

Hardened fork of Vaultwarden (https://github.com/dani-garcia/vaultwarden) with fewer features.
git clone https://git.philomathiclife.com/repos/vw_small
Log | Files | Refs | README

commit c5b97f4146fd387c6845f52bec6d6ee02cc61413
parent 8867626de898bb8416ed8319806b1c220d57dcb1
Author: Daniel GarcĂ­a <dani-garcia@users.noreply.github.com>
Date:   Sun, 16 Feb 2020 22:12:00 +0100

Merge pull request #864 from mprasil/admin-invitation

Do not disable invitations via admin API
Diffstat:
Msrc/api/admin.rs | 4----
Msrc/db/models/user.rs | 9++++-----
2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/src/api/admin.rs b/src/api/admin.rs @@ -153,10 +153,6 @@ fn invite_user(data: Json<InviteData>, _token: AdminToken, conn: DbConn) -> Empt err!("User already exists") } - if !CONFIG.invitations_allowed() { - err!("Invitations are not allowed") - } - let mut user = User::new(email); user.save(&conn)?; diff --git a/src/db/models/user.rs b/src/db/models/user.rs @@ -319,10 +319,9 @@ impl Invitation { } pub fn take(mail: &str, conn: &DbConn) -> bool { - CONFIG.invitations_allowed() - && match Self::find_by_mail(mail, &conn) { - Some(invitation) => invitation.delete(&conn).is_ok(), - None => false, - } + match Self::find_by_mail(mail, &conn) { + Some(invitation) => invitation.delete(&conn).is_ok(), + None => false, + } } }