Skip to content

Commit 08d0803

Browse files
Send authentication attribute to Group-IB when set on session
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 7b2887d commit 08d0803

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

src/libs/FraudProtection/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ function sendAccountAttributes() {
1414
setAttribute('email', cachedAccount?.primaryLogin ?? '', false, true);
1515
setAttribute('mfa', cachedAccount?.requiresTwoFactorAuth ? '2fa_enabled' : '2fa_disabled', false, true);
1616
setAttribute('is_validated', cachedAccount?.validated ? 'true' : 'false', false, true);
17+
if (cachedSession?.authMethod) {
18+
setAttribute('authentication', cachedSession.authMethod, false, true);
19+
}
1720
}
1821

1922
function trySendToFraudProtection() {

src/types/onyx/Session.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ type Session = {
4848

4949
/** Timestamp of the session creation date */
5050
creationDate?: number;
51+
52+
/** How the user authenticated for the current session, forwarded to the fraud protection backend */
53+
authMethod?: string;
5154
};
5255

5356
export default Session;

0 commit comments

Comments
 (0)