mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-04 00:53:49 +00:00
Add pending
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user