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 9479108fb7861b2abf67be9c7825c6b7f3e4fa3d
parent 042c1072d9f35003348815288693324028646a5d
Author: Nick Fox <nick@foxsec.net>
Date:   Mon, 17 Dec 2018 17:10:09 -0500

Remove CONFIG.email_invitations

Diffstat:
Msrc/api/core/accounts.rs | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/api/core/accounts.rs b/src/api/core/accounts.rs @@ -59,7 +59,7 @@ fn register(data: JsonUpcase<RegisterData>, conn: DbConn) -> EmptyResult { let mut user = match User::find_by_mail(&data.Email, &conn) { Some(user) => { - if !CONFIG.email_invitations { + if CONFIG.mail.is_none() { if Invitation::take(&data.Email, &conn) { for mut user_org in UserOrganization::find_invited_by_user(&user.uuid, &conn).iter_mut() { user_org.status = UserOrgStatus::Accepted as i32; @@ -79,7 +79,7 @@ fn register(data: JsonUpcase<RegisterData>, conn: DbConn) -> EmptyResult { } } None => { - if CONFIG.signups_allowed || (!CONFIG.email_invitations && Invitation::take(&data.Email, &conn)) { + if CONFIG.signups_allowed || (CONFIG.mail.is_none() && Invitation::take(&data.Email, &conn)) { User::new(data.Email) } else { err!("Registration not allowed")