Skip to main content

Action

The following Post Login action renders a marketing consent Form to users who haven’t answered it yet, then handles the submitted response on the following login attempt: denying access if the Form was skipped, or storing the consent choice in user_metadata otherwise.
mock-form-render.js

Unit Test

The unit tests mock the event and api objects to verify the Form renders only when consent hasn’t been answered, and that both accepted and declined consent submissions are stored correctly while missing submissions are denied.
mock-form-render.spec.js
package.json
mock-form-render.spec.js
package.json
.mocharc.json
mock-form-render.spec.js
package.json