Jump to content
McKay Development

Recommended Posts

Posted

Hi,

it is possible to set API?

Trade-offers:
 

this.apiKey = null;
this._community.getWebApiKey(this._domain, (err, key) => {
    if (err) {
        callback(err);
        return;
    }

    this.apiKey = key;
    callback();
});


I can make a pull request to change 

this.apiKey = (options.apiKey || null);

Or there is a reason for not giving option to pass api key?

Posted

Or there is a reason for not giving option to pass api key?

 

Yes, because ignorant coders will almost definitely start passing API keys that don't belong to the account they're signed into, and start posting GitHub issues asking what's going on.

 

If you know what you're doing, you can set the apiKey property directly with the correct key, but please make sure you actually know what you're doing.

Posted

Yes, because ignorant coders will almost definitely start passing API keys that don't belong to the account they're signed into, and start posting GitHub issues asking what's going on.

 

If you know what you're doing, you can set the apiKey property directly with the correct key, but please make sure you actually know what you're doing.

 

Hi, thanks for reply, yes I ended up doing it directly:

 

user.on('webSession', function(sessionID, cookies) {

	console.log(data.login+': Got webSession');

	manager.apiKey = data.api_key;

	manager.setCookies(cookies, function(err) {});

	community.setCookies(cookies);
});

Yes, I manually generate the API KEY (Because I use same KEY for LOGIN) just less request and hassle because I know the API KEY.

 

Thank you.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...