Skip to content

MOEN-46074: Add JWT authentication support - #132

Open
abhishek-engg-mobilesdk wants to merge 2 commits into
developmentfrom
feature/MOEN-46074-jwt_authentication
Open

MOEN-46074: Add JWT authentication support#132
abhishek-engg-mobilesdk wants to merge 2 commits into
developmentfrom
feature/MOEN-46074-jwt_authentication

Conversation

@abhishek-engg-mobilesdk

Copy link
Copy Markdown
Contributor

Jira Ticket

https://moengagetrial.atlassian.net/browse/MOEN-45977

Description

JWT authentication support

Adds passAuthenticationDetails() and the authenticationError event across the TS, iOS, and Android bridges.
@moe-hodor

moe-hodor Bot commented Jul 23, 2026

Copy link
Copy Markdown

🚪 Hodor is reviewing this PR... 👀

@moe-hodor moe-hodor Bot added cfr:neutral Change Failure Rate: neutral impact branch:feature Planned work — new functionality or enhancement (neutral CFR) labels Jul 23, 2026
Comment thread sdk/core/src/moeParser/MoEngagePayloadParser.ts

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning — Missing event handler case: The executeHandler function handles LOGOUT_COMPLETE (line 28-30) but does not handle the new AUTHENTICATION_ERROR event. Based on the diff in index.ts line +115, the event name is "authenticationError", and the test file shows it should be handled.

Fix: Add a case after line 30:

} else if (type == AUTHENTICATION_ERROR) {
    let authErrorData = getAuthenticationErrorData(notificationPayload);
    authErrorData != undefined ? handler(authErrorData) : null;

You'll also need to:

  1. Import AUTHENTICATION_ERROR constant from ".." (see test file line +18)
  2. Import getAuthenticationErrorData from "../moeParser/MoEngagePayloadParser"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already handled — the AUTHENTICATION_ERROR branch is in executeHandler. Same as above, stale against an earlier commit.

Comment thread ExpoSampleApp/src/ui/core/CoreAPIs.tsx Outdated

@moe-hodor moe-hodor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: MOEN-46074 — Add JWT authentication support

Issues (5 after filtering):
🔴 Critical: 2
⚠️ Warning: 2
💡 Suggestion: 1

Hodor filtered 5 low-signal comment(s) to reduce noise.
Verdict: REQUEST_CHANGES

Comment thread sdk/core/src/models/MoEAuthenticationErrorData.ts Outdated
Comment thread sdk/core/src/models/MoEAuthenticationData.ts Outdated
- Add MoEAuthenticationDetails / MoEAuthenticationErrorDetails base classes
  (MoEAction pattern); MoEJwtAuthenticationData and MoEJwtAuthenticationErrorData
  extend them, and the `data` fields are typed as the base so future auth
  schemes can be added without changing these types.
- Rename sample JWT placeholders to <YOUR_JWT_TOKEN> / <YOUR_USER_IDENTIFIER>.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

branch:feature Planned work — new functionality or enhancement (neutral CFR) cfr:neutral Change Failure Rate: neutral impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants