mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-05-19 01:53:56 +00:00
validate billing_email on save
This commit is contained in:
parent
31b77bf178
commit
870f0d0932
3 changed files with 9 additions and 0 deletions
|
@ -217,6 +217,10 @@ use crate::error::MapResult;
|
|||
/// Database methods
|
||||
impl Organization {
|
||||
pub async fn save(&self, conn: &mut DbConn) -> EmptyResult {
|
||||
if !email_address::EmailAddress::is_valid(self.billing_email.trim()) {
|
||||
err!(format!("BillingEmail {} is not a valid email address", self.billing_email.trim()))
|
||||
}
|
||||
|
||||
for user_org in UserOrganization::find_by_org(&self.uuid, conn).await.iter() {
|
||||
User::update_uuid_revision(&user_org.user_uuid, conn).await;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue