Add pending

This commit is contained in:
Owen
2026-01-16 14:37:06 -08:00
parent e2cbe11a5f
commit a126494c12
2 changed files with 13 additions and 0 deletions

View File

@@ -5,6 +5,7 @@ export const OlmErrorCodes = {
CLIENT_ID_NOT_FOUND: "CLIENT_ID_NOT_FOUND",
CLIENT_NOT_FOUND: "CLIENT_NOT_FOUND",
CLIENT_BLOCKED: "CLIENT_BLOCKED",
CLIENT_PENDING: "CLIENT_PENDING",
ORG_NOT_FOUND: "ORG_NOT_FOUND",
USER_ID_NOT_FOUND: "USER_ID_NOT_FOUND",
INVALID_USER_SESSION: "INVALID_USER_SESSION",

View File

@@ -90,6 +90,18 @@ export const handleOlmRegisterMessage: MessageHandler = async (context) => {
return;
}
if (client.approvalState == "pending") {
logger.debug(
`Client ${client.clientId} approval is pending. Ignoring register.`
);
sendOlmError(
OlmErrorCodes.CLIENT_PENDING,
"Client approval is pending",
olm.olmId
);
return;
}
const [org] = await db
.select()
.from(orgs)