mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-13 12:16:54 +00:00
fix: check for user account status before attemping to process email change.
This commit is contained in:
1 parent
cbdf978b84
commit
684820c7c1
2 files changed
+4
No files matched your search
@@ -1083,6 +1083,9 @@ impl crate::Context<'_> {
|
||||
|
||||
pub(super) async fn change_email(&self, user_id: String, email: Option<String>) -> Result {
|
||||
let user_id = parse_local_user_id(self.services, &user_id)?;
|
||||
if matches!(self.services.users.status(&user_id).await, AccountStatus::NotFound) {
|
||||
return Err!("This account does not exist.");
|
||||
}
|
||||
let Ok(new_email) = email.map(Address::try_from).transpose() else {
|
||||
return Err!("Invalid email address.");
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user