Skip to content

Commit

Permalink
fix: get notifications not authorized
Browse files Browse the repository at this point in the history
  • Loading branch information
chris13524 committed Jan 20, 2024
1 parent c4a0542 commit 5d694c7
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use {
},
state::AppState,
types::{Envelope, EnvelopeType0},
utils::topic_from_key,
utils::{is_same_address, topic_from_key},
},
base64::Engine,
chrono::Utc,
Expand Down Expand Up @@ -122,6 +122,13 @@ pub async fn handle(msg: PublishedMessage, state: &AppState) -> Result<(), Relay
}
}

if !is_same_address(&account, &subscriber.account) {
Err(RelayMessageServerError::NotifyServerError(
NotifyServerError::AccountNotAuthorized,
))?;
// TODO change to client error?
}

account
};

Expand Down

0 comments on commit 5d694c7

Please sign in to comment.