mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-10 20:02:26 +00:00
show fingerprint popup and fix policy check errors
This commit is contained in:
@@ -115,6 +115,8 @@ export const handleOlmRegisterMessage: MessageHandler = async (context) => {
|
||||
sessionId // this is the user token passed in the message
|
||||
});
|
||||
|
||||
logger.debug("Policy check result:", policyCheck);
|
||||
|
||||
if (policyCheck?.error) {
|
||||
logger.error(
|
||||
`Error checking access policies for olm user ${olm.userId} in org ${orgId}: ${policyCheck?.error}`
|
||||
@@ -123,7 +125,10 @@ export const handleOlmRegisterMessage: MessageHandler = async (context) => {
|
||||
return;
|
||||
}
|
||||
|
||||
if (policyCheck?.policies?.passwordAge?.compliant) {
|
||||
if (
|
||||
policyCheck?.policies?.passwordAge &&
|
||||
!policyCheck.policies.passwordAge.compliant
|
||||
) {
|
||||
logger.warn(
|
||||
`Olm user ${olm.userId} has non-compliant password age for org ${orgId}`
|
||||
);
|
||||
@@ -132,7 +137,10 @@ export const handleOlmRegisterMessage: MessageHandler = async (context) => {
|
||||
olm.olmId
|
||||
);
|
||||
return;
|
||||
} else if (policyCheck?.policies?.maxSessionLength?.compliant) {
|
||||
} else if (
|
||||
policyCheck?.policies?.maxSessionLength &&
|
||||
!policyCheck.policies.maxSessionLength.compliant
|
||||
) {
|
||||
logger.warn(
|
||||
`Olm user ${olm.userId} has non-compliant session length for org ${orgId}`
|
||||
);
|
||||
@@ -141,7 +149,10 @@ export const handleOlmRegisterMessage: MessageHandler = async (context) => {
|
||||
olm.olmId
|
||||
);
|
||||
return;
|
||||
} else if (policyCheck?.policies?.requiredTwoFactor) {
|
||||
} else if (
|
||||
policyCheck?.policies &&
|
||||
!policyCheck.policies.requiredTwoFactor
|
||||
) {
|
||||
logger.warn(
|
||||
`Olm user ${olm.userId} does not have 2FA enabled for org ${orgId}`
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user