From 7db66f73f03e577132fabd88a8089bece1549c0f Mon Sep 17 00:00:00 2001 From: Nick Fox Date: Sat, 5 Jan 2019 13:46:45 -0500 Subject: [PATCH] Refactor invited_by_email check --- src/api/core/organizations.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/core/organizations.rs b/src/api/core/organizations.rs index 91f5ac7..d0a5f00 100644 --- a/src/api/core/organizations.rs +++ b/src/api/core/organizations.rs @@ -609,9 +609,9 @@ fn accept_invite(_org_id: String, _org_user_id: String, data: JsonUpcase org.name, None => String::from("bitwarden_rs"), }; - if claims.invited_by_email.is_some() { + if let Some(invited_by_email) = &claims.invited_by_email { // User was invited to an organization, so they must be confirmed manually after acceptance - mail::send_invite_accepted(&claims.email, &claims.invited_by_email.unwrap(), &org_name, mail_config)?; + mail::send_invite_accepted(&claims.email, invited_by_email, &org_name, mail_config)?; } else { // User was invited from /admin, so they are automatically confirmed mail::send_invite_confirmed(&claims.email, &org_name, mail_config)?;