Redirect Rule during Signup

I want to redirect the user whenever he signs up, so that before saving him in our database, i am able to take some more details.
For this, I am going to redirect to a page on our site where we will collect more data, send it to backend server and then continue later using the state. For this, I also want to send the accessToken generated on Auth0 for security reasons. I don’t want attackers trying to send their custom requests, our server will verify token to authenticate the request(I hope i am right about this?).

However, how do I access the accessToken string from the context object?
Here is what I have now:

function (user, context, callback) {
  if (context.stats.loginsCount === 1) {
		context.redirect = {
    	url: `https://xx-staging.com/auth0-signup?email=${user.email}&accessToken=${}`  //where do i add access token?
		};
  }
  callback(null, user, context);
}

Docs state that:

context.accessToken An object representing the options defined on the Access Token.

How do I get the string rather than the object because this is not documented here?

Hey there,

I checked our docs on rules:

and found this:

So context as well as accessToken are objects so they both have properties that you can access.

Hey there!

As this topic is related to Rules - Hooks - Actions and Rules & Hooks are being deprecated soon, I’m excited to let you know about our next Ask me Anything session in the Forum on Thursday, January 18 with the Rules, Hooks and Actions team on Rules & Hooks and why Actions matter! Submit your questions in the thread above and our esteemed product experts will provide written answers on January 18. Find out more about Rules & Hooks and why Actions matter! Can’t wait to see you there!

Learn more here!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.