Give custom state with NodeJS API library


I am using GitHub - Asana/node-asana: Official node.js and browser JS client for the Asana API v1 and I can’t find a way to pass a custom state to the OAuth process. When the user comes back from the authentication I need to know where he was. I could store the information in local storage but with the PHP library I was able to store the information in the state.


cc @Diakoptis the best with the API :sunglasses:

I did’t understand the question :frowning:

When using OAuth you can pass a state, usually a string, that is passed along the whole process and that you can get back when the user comes back authenticated in your app. That way you can track for example where they were before starting the authentication process. In my case that would be the template they chose. Do you understand better?

@Matt_Bramlage @johnnygoodnow any help possible?


Ok i got it. As i can see the library use a random state id (asana_timestamp) at lib/auth/oauth_util.js. I am not sure that the library supports a custom state.✓&q=state

Exactly. I am going to use a localStorage variable I think.