Passing user option to rule/access-token after login

Hi @george.kollias,

I just tested this out, and it looks like when you pass custom parameters in the auth0.getTokenSilently, they are accessible in the rule in context.request.query:

const getToken = () => {
  try {
    auth0.getTokenSilently({
      useroption: "test123"
    });
  } catch (err) {
    console.log("Log out failed", err);
  }
};

This is easier to debug with Real-time Webtask Logs Extension

Also, it may help to see the API reference for getTokenSilently: https://auth0.github.io/auth0-spa-js/classes/auth0client.html#gettokensilently

This request will pull the token from memory when a valid one is available, so it is possible that the rule will not run if there is a valid token available.

1 Like