aboutsummaryrefslogtreecommitdiff
path: root/src/api/identity.rs
diff options
context:
space:
mode:
authorAdam Jones <[email protected]>2021-09-24 17:55:49 +0200
committerAdam Jones <[email protected]>2021-10-02 19:30:19 +0200
commitd014eede9a7fa85e4f809656a7f6aed61caafff0 (patch)
tree52b9b114b45e66606101ea7b9be3403261296b33 /src/api/identity.rs
parent9930a0d75224202dbc355e945724aa545bedebe2 (diff)
downloadvaultwarden-d014eede9a7fa85e4f809656a7f6aed61caafff0.tar.gz
vaultwarden-d014eede9a7fa85e4f809656a7f6aed61caafff0.zip
feature: Support single organization policy
This adds back-end support for the [single organization policy](https://bitwarden.com/help/article/policies/#single-organization).
Diffstat (limited to 'src/api/identity.rs')
-rw-r--r--src/api/identity.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/api/identity.rs b/src/api/identity.rs
index 1c1ab233..bfc47570 100644
--- a/src/api/identity.rs
+++ b/src/api/identity.rs
@@ -56,7 +56,7 @@ fn _refresh_login(data: ConnectData, conn: DbConn) -> JsonResult {
// COMMON
let user = User::find_by_uuid(&device.user_uuid, &conn).unwrap();
- let orgs = UserOrganization::find_by_user(&user.uuid, &conn);
+ let orgs = UserOrganization::find_confirmed_by_user(&user.uuid, &conn);
let (access_token, expires_in) = device.refresh_tokens(&user, orgs);
@@ -147,7 +147,7 @@ fn _password_login(data: ConnectData, conn: DbConn, ip: &ClientIp) -> JsonResult
}
// Common
- let orgs = UserOrganization::find_by_user(&user.uuid, &conn);
+ let orgs = UserOrganization::find_confirmed_by_user(&user.uuid, &conn);
let (access_token, expires_in) = device.refresh_tokens(&user, orgs);
device.save(&conn)?;