diff --git a/packages/marko-web-identity-x/browser/authenticate.vue b/packages/marko-web-identity-x/browser/authenticate.vue index 72caf4dfd..b5248d410 100644 --- a/packages/marko-web-identity-x/browser/authenticate.vue +++ b/packages/marko-web-identity-x/browser/authenticate.vue @@ -247,6 +247,11 @@ export default { isProfileComplete: this.isProfileComplete, requiresCustomFieldAnswers: this.requiresCustomFieldAnswers, actionSource: data.loginSource, + ...( + data.additionalContext + && data.additionalContext.newsletterSignupType + && { newsletterSignupType: data.additionalContext.newsletterSignupType } + ), additionalEventData: { ...(this.additionalEventData || {}), ...(data.additionalEventData || {}), diff --git a/packages/marko-web-identity-x/routes/authenticate.js b/packages/marko-web-identity-x/routes/authenticate.js index bcfb2a7ad..4ae069163 100644 --- a/packages/marko-web-identity-x/routes/authenticate.js +++ b/packages/marko-web-identity-x/routes/authenticate.js @@ -1,4 +1,5 @@ const gql = require('graphql-tag'); +const { getAsObject } = require('@parameter1/base-cms-object-path'); const { asyncRoute } = require('@parameter1/base-cms-utils'); const tokenCookie = require('../utils/token-cookie'); const contextCookie = require('../utils/context-cookie'); @@ -16,6 +17,7 @@ const loginAppUser = gql` ...ActiveUserFragment } loginSource + additionalContext } } @@ -51,6 +53,7 @@ module.exports = asyncRoute(async (req, res) => { applicationId: identityX.config.getAppId(), user, loginSource, + additionalContext: getAsObject(data, 'loginAppUser.additionalContext'), additionalEventData, entity, }); diff --git a/packages/marko-web-identity-x/service.js b/packages/marko-web-identity-x/service.js index 0b766f9db..41abd9f80 100644 --- a/packages/marko-web-identity-x/service.js +++ b/packages/marko-web-identity-x/service.js @@ -444,6 +444,7 @@ class IdentityX { appContextId: this.config.get('appContextId'), source, redirectTo, + additionalContext: additionalEventData, }, }, });