There should be a better way of setting the locationid. I wouldn't know to set locationid when I don't use the built in oauth functions.
const locationid = 1; // Which translates to "api.pcloud.com"
const client = pcloudSdk.createClient(authToken, 'oauth', locationid);
Sometimes I've got a node server that already has an authentication token and doesn't need to prompt for another authToken.
The error I get is:
ReferenceError: locationid is not defined at ApiMethod
Alternatively I know I can do this:
global.locationid = 1;
const authToken = await getAuth(); // Calls userinfo
const client = pcloudSdk.createClient(authToken, 'pcloud', false);
Alternatively, we can provide a way to call userInfo under oAuth by passing the username and password. (With a note to use HTTPS).
The goal is to get the userInfo server side on a java server for instance.
Which does work. I just would rather pass in locationid under ApiMethod or on the client level if possible.
There should be a better way of setting the
locationid. I wouldn't know to setlocationidwhen I don't use the built in oauth functions.Sometimes I've got a node server that already has an authentication token and doesn't need to prompt for another authToken.
The error I get is:
ReferenceError: locationid is not defined at ApiMethodAlternatively I know I can do this:
Alternatively, we can provide a way to call userInfo under oAuth by passing the username and password. (With a note to use HTTPS).
The goal is to get the userInfo server side on a java server for instance.
Which does work. I just would rather pass in locationid under ApiMethod or on the client level if possible.