mirror of
https://github.com/stalwartlabs/mail-server.git
synced 2025-12-11 05:46:25 +08:00
Skip account ids that no longer exist in internal directories (closes #2352)
Some checks failed
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled
Some checks failed
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled
This commit is contained in:
parent
7ac984e1c0
commit
4919cf55fc
1 changed files with 10 additions and 5 deletions
|
|
@ -11,7 +11,6 @@ use jmap_proto::request::capability::{
|
||||||
};
|
};
|
||||||
use std::future::Future;
|
use std::future::Future;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use trc::AddContext;
|
|
||||||
use types::id::Id;
|
use types::id::Id;
|
||||||
use utils::map::vec_map::VecMap;
|
use utils::map::vec_map::VecMap;
|
||||||
|
|
||||||
|
|
@ -57,10 +56,16 @@ impl SessionHandler for Server {
|
||||||
// Add secondary accounts
|
// Add secondary accounts
|
||||||
for &account_id in access_token.secondary_ids() {
|
for &account_id in access_token.secondary_ids() {
|
||||||
let is_owner = access_token.is_member(account_id);
|
let is_owner = access_token.is_member(account_id);
|
||||||
let access_token = self
|
let access_token = match self.get_access_token(account_id).await {
|
||||||
.get_access_token(account_id)
|
Ok(token) => token,
|
||||||
.await
|
Err(err) => {
|
||||||
.caused_by(trc::location!())?;
|
if err.matches(trc::EventType::Auth(trc::AuthEvent::Error)) {
|
||||||
|
continue;
|
||||||
|
} else {
|
||||||
|
return Err(err.caused_by(trc::location!()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
let account_id = Id::from(account_id);
|
let account_id = Id::from(account_id);
|
||||||
let mut account = Account {
|
let mut account = Account {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue