Give custom state with NodeJS API library


#1

Hi,

I am using https://github.com/Asana/node-asana 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.

Thanks!

cc @Diakoptis the best with the API :sunglasses:


#2

I did’t understand the question :frowning:


#3

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?

Thanks!


#4

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.


#5

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