Skip to content

Provide AuthToken but still require locationid. #60

@digitalepicfury

Description

@digitalepicfury

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions