0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-10-01 13:18:58 +02:00

ircd:Ⓜ️:vm: Add missing fault::AUTH exception.

This commit is contained in:
Jason Volk 2020-04-27 19:54:54 -07:00
parent 9c61677b0b
commit 6818f98ae6

View file

@ -534,7 +534,19 @@ ircd::m::vm::execute_pdu(eval &eval,
// Evaluation by auth system; throws // Evaluation by auth system; throws
if(likely(authenticate)) if(likely(authenticate))
room::auth::check_static(event); {
const auto &[pass, fail]
{
room::auth::check_static(event)
};
if(!pass)
throw error
{
fault::AUTH, "Fails against provided auth_events :%s",
what(fail)
};
}
// Obtain sequence number here. // Obtain sequence number here.
const auto *const &top(eval::seqmax()); const auto *const &top(eval::seqmax());
@ -559,7 +571,19 @@ ircd::m::vm::execute_pdu(eval &eval,
}); });
if(likely(authenticate)) if(likely(authenticate))
room::auth::check_relative(event); {
const auto &[pass, fail]
{
room::auth::check_relative(event)
};
if(!pass)
throw error
{
fault::AUTH, "Fails relative to the state at the event :%s",
what(fail)
};
}
log::debug log::debug
{ {