I’m trying to pass a ref
query parameter during signup
using loginWithRedirect({ authorizationParams: { screen_hint: "signup", ref: "xyz" } })
, and I want to access that flag in the onExecutePostUserRegistration
action.
I tried this code:
js
CopyEdit
exports.onExecutePostUserRegistration = async (event, api) => {
const ref = event.request.query?.ref;
if (ref) {
api.user.setUserMetadata("ref", ref);
}
};
But it looks like event.request.query
is undefined or doesn’t include the query string. I suspect the ref
param doesn’t survive the email verification link.
What’s the recommended way to pass a referral flag or other custom data through the signup process and access it in the Post User Registration Action?
I want to avoid a database or session store unless necessary.