Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Got Not authorized when use dir function #16

Open
slim-hmidi opened this issue Jul 1, 2019 · 1 comment
Open

Got Not authorized when use dir function #16

slim-hmidi opened this issue Jul 1, 2019 · 1 comment

Comments

@slim-hmidi
Copy link

slim-hmidi commented Jul 1, 2019

I'm trying to use the function dir:

const Netstorage = require('netstorageapi')

// Defaults: SSL: false
// By default no proxy is set
const config = {
hostname: "hostname",
keyName: "keyName",
key: "key",
cpCode: "cpCOde",
ssl: false,
}
// Don't expose KEY on your public repository.

const ns = new Netstorage(config)

ns.list('test', (err, response, body) => {
      if (err) {
        console.log('err: ', err)
      }
      console.log('body: ', body)
    })

Whatever the path I put (valid or not) I get the same message:

body:  { message: 'Not Authorized.' }

What's wrong?

@mick-feller
Copy link

I ran in the same issue and adding to your ns.list path
try this:

ns.list(`/${config.cpCode}/test`, (err, response, body) => {
      if (err) {
        console.log('err: ', err)
      }
      console.log('body: ', body)
    })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants