aboutsummaryrefslogtreecommitdiff
path: root/src/api/core/accounts.rs
diff options
context:
space:
mode:
authorDaniel GarcĂ­a <[email protected]>2021-10-19 20:14:29 +0200
committerGitHub <[email protected]>2021-10-19 20:14:29 +0200
commitf94ac6ca61e24952e3906018ee54615cf9c123ec (patch)
treefb1031de6f9b5619161c5123023adb554fb30543 /src/api/core/accounts.rs
parent016fe2269e3079be65f86c4887b959341c984bfa (diff)
parentcee3fd5ba284f376cd05755dbc9cd6b7ded297ed (diff)
downloadvaultwarden-1.23.0.tar.gz
vaultwarden-1.23.0.zip
Merge pull request #2044 from jjlin/emergency-access-cleanup1.23.0
Emergency Access cleanup
Diffstat (limited to 'src/api/core/accounts.rs')
-rw-r--r--src/api/core/accounts.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/api/core/accounts.rs b/src/api/core/accounts.rs
index 4e613a37..93636889 100644
--- a/src/api/core/accounts.rs
+++ b/src/api/core/accounts.rs
@@ -91,10 +91,9 @@ fn register(data: JsonUpcase<RegisterData>, conn: DbConn) -> EmptyResult {
user
} else if CONFIG.is_signup_allowed(&email) {
// check if it's invited by emergency contact
- if EmergencyAccess::find_invited_by_grantee_email(&data.Email, &conn).is_some() {
- user
- } else {
- err!("Account with this email already exists")
+ match EmergencyAccess::find_invited_by_grantee_email(&data.Email, &conn) {
+ Some(_) => user,
+ _ => err!("Account with this email already exists"),
}
} else {
err!("Registration not allowed or user already exists")