mirror of
				https://github.com/dani-garcia/vaultwarden.git
				synced 2025-10-28 00:40:01 +02:00 
			
		
		
		
	completly hide reset password policy
on email disabled instances
This commit is contained in:
		| @@ -1585,10 +1585,6 @@ async fn put_policy( | |||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     if pol_type_enum == OrgPolicyType::ResetPassword && data.enabled && !CONFIG.mail_enabled() { |  | ||||||
|         err!("Due to potential security flaws and/or misuse reset password policy is disabled on mail disabled instances") |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     let mut policy = match OrgPolicy::find_by_org_and_type(&org_id, pol_type_enum, &mut conn).await { |     let mut policy = match OrgPolicy::find_by_org_and_type(&org_id, pol_type_enum, &mut conn).await { | ||||||
|         Some(p) => p, |         Some(p) => p, | ||||||
|         None => OrgPolicy::new(org_id.clone(), pol_type_enum, "{}".to_string()), |         None => OrgPolicy::new(org_id.clone(), pol_type_enum, "{}".to_string()), | ||||||
|   | |||||||
| @@ -159,7 +159,7 @@ impl Organization { | |||||||
|             "SelfHost": true, |             "SelfHost": true, | ||||||
|             "UseApi": false, // Not supported |             "UseApi": false, // Not supported | ||||||
|             "HasPublicAndPrivateKeys": self.private_key.is_some() && self.public_key.is_some(), |             "HasPublicAndPrivateKeys": self.private_key.is_some() && self.public_key.is_some(), | ||||||
|             "UseResetPassword": true, |             "UseResetPassword": CONFIG.mail_enabled(), | ||||||
|  |  | ||||||
|             "BusinessName": null, |             "BusinessName": null, | ||||||
|             "BusinessAddress1": null, |             "BusinessAddress1": null, | ||||||
| @@ -314,7 +314,7 @@ impl UserOrganization { | |||||||
|             "SelfHost": true, |             "SelfHost": true, | ||||||
|             "HasPublicAndPrivateKeys": org.private_key.is_some() && org.public_key.is_some(), |             "HasPublicAndPrivateKeys": org.private_key.is_some() && org.public_key.is_some(), | ||||||
|             "ResetPasswordEnrolled": self.reset_password_key.is_some(), |             "ResetPasswordEnrolled": self.reset_password_key.is_some(), | ||||||
|             "UseResetPassword": true, |             "UseResetPassword": CONFIG.mail_enabled(), | ||||||
|             "SsoBound": false, // Not supported |             "SsoBound": false, // Not supported | ||||||
|             "UseSso": false, // Not supported |             "UseSso": false, // Not supported | ||||||
|             "ProviderId": null, |             "ProviderId": null, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user