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

401 error after installation / setup #4

Open
plantainrain opened this issue Jun 4, 2019 · 0 comments
Open

401 error after installation / setup #4

plantainrain opened this issue Jun 4, 2019 · 0 comments

Comments

@plantainrain
Copy link

after installing and configuring my site with the following local.js

module.exports = {
  modules: {
    'pk-basic-auth': {
      users: {
        'admin': 'demo'
      }
    }
  }
}

I get the following 401 error on an existing default page. Creating a new page of that type works fine. This is the only page that's affected. Removing the local.js module config removes the error.

 { Error: Request failed with status code 401
     at createError (/Users/punkave/Sites/pennpain/node_modules/axios/lib/core/createError.js:16:15)
     at settle (/Users/punkave/Sites/pennpain/node_modules/axios/lib/core/settle.js:18:12)
     at IncomingMessage.handleStreamEnd (/Users/punkave/Sites/pennpain/node_modules/axios/lib/adapters/http.js:201:11)
     at emitNone (events.js:111:20)
     at IncomingMessage.emit (events.js:208:7)
     at endReadableNT (_stream_readable.js:1064:12)
     at _combinedTickCallback (internal/process/next_tick.js:138:11)
     at process._tickCallback (internal/process/next_tick.js:180:9)
   config:
    { adapter: [Function: httpAdapter],
      transformRequest: { '0': [Function: transformRequest] },
      transformResponse: { '0': [Function: transformResponse] },
      timeout: 0,
      xsrfCookieName: 'XSRF-TOKEN',
      xsrfHeaderName: 'X-XSRF-TOKEN',
      maxContentLength: -1,
      validateStatus: [Function: validateStatus],
      headers:
       { Accept: 'application/json, text/plain, */*',
         'User-Agent': 'axios/0.18.0' },
      method: 'get',
      url: 'http://localhost:3000/modules/medication-options/get-med-options',
      responseType: 'json',
      data: undefined },
   request:
    ClientRequest {
      domain: null,
      _events:
       { socket: [Function],
         abort: [Function],
         aborted: [Function],
         error: [Function],
         timeout: [Function],
         prefinish: [Function: requestOnPrefinish] },
      _eventsCount: 6,
      _maxListeners: undefined,
      output: [],
      outputEncodings: [],
      outputCallbacks: [],
      outputSize: 0,
      writable: true,
      _last: true,
      upgrading: false,
      chunkedEncoding: false,
      shouldKeepAlive: false,
      useChunkedEncodingByDefault: false,
      sendDate: false,
      _removedConnection: false,
      _removedContLen: false,
      _removedTE: false,
      _contentLength: 0,
      _hasBody: true,
      _trailer: '',
      finished: true,
      _headerSent: true,
      socket:
       Socket {
         connecting: false,
         _hadError: false,
         _handle: null,
         _parent: null,
         _host: 'localhost',
         _readableState: [Object],
         readable: false,
         domain: null,
         _events: [Object],
         _eventsCount: 8,
         _maxListeners: undefined,
         _writableState: [Object],
         writable: false,
         allowHalfOpen: false,
         _bytesDispatched: 170,
         _sockname: null,
         _pendingData: null,
         _pendingEncoding: '',
         server: null,
         _server: null,
         parser: null,
         _httpMessage: [Circular],
         _idleNext: null,
         _idlePrev: null,
         _idleTimeout: -1,
         [Symbol(asyncId)]: 30092,
         [Symbol(bytesRead)]: 233 },
      connection:
       Socket {
         connecting: false,
         _hadError: false,
         _handle: null,
         _parent: null,
         _host: 'localhost',
         _readableState: [Object],
         readable: false,
         domain: null,
         _events: [Object],
         _eventsCount: 8,
         _maxListeners: undefined,
         _writableState: [Object],
         writable: false,
         allowHalfOpen: false,
         _bytesDispatched: 170,
         _sockname: null,
         _pendingData: null,
         _pendingEncoding: '',
         server: null,
         _server: null,
         parser: null,
         _httpMessage: [Circular],
         _idleNext: null,
         _idlePrev: null,
         _idleTimeout: -1,
         [Symbol(asyncId)]: 30092,
         [Symbol(bytesRead)]: 233 },
      _header: 'GET /modules/medication-options/get-med-options HTTP/1.1\r\nAccept: application/json, text/plain, */*\r\nUser-Agent: axios/0.18.0\r\nHost: localhost:3000\r\nConnection: close\r\n\r\n',
      _onPendingData: [Function: noopPendingOutput],
      agent:
       Agent {
         domain: null,
         _events: [Object],
         _eventsCount: 1,
         _maxListeners: undefined,
         defaultPort: 80,
         protocol: 'http:',
         options: [Object],
         requests: {},
         sockets: [Object],
         freeSockets: {},
         keepAliveMsecs: 1000,
         keepAlive: false,
         maxSockets: Infinity,
         maxFreeSockets: 256 },
      socketPath: undefined,
      timeout: undefined,
      method: 'GET',
      path: '/modules/medication-options/get-med-options',
      _ended: true,
      res:
       IncomingMessage {
         _readableState: [Object],
         readable: false,
         domain: null,
         _events: [Object],
         _eventsCount: 3,
         _maxListeners: undefined,
         socket: [Object],
         connection: [Object],
         httpVersionMajor: 1,
         httpVersionMinor: 1,
         httpVersion: '1.1',
         complete: true,
         headers: [Object],
         rawHeaders: [Array],
         trailers: {},
         rawTrailers: [],
         upgrade: false,
         url: '',
         method: null,
         statusCode: 401,
         statusMessage: 'Unauthorized',
         client: [Object],
         _consuming: true,
         _dumped: false,
         req: [Circular],
         responseUrl: 'http://localhost:3000/modules/medication-options/get-med-options',
         redirects: [],
         read: [Function] },
      aborted: undefined,
      timeoutCb: null,
      upgradeOrConnect: false,
      parser: null,
      maxHeadersCount: null,
      _redirectable:
       Writable {
         _writableState: [Object],
         writable: true,
         domain: null,
         _events: [Object],
         _eventsCount: 2,
         _maxListeners: undefined,
         _options: [Object],
         _ended: true,
         _ending: true,
         _redirectCount: 0,
         _redirects: [],
         _requestBodyLength: 0,
         _requestBodyBuffers: [],
         _onNativeResponse: [Function],
         _currentRequest: [Circular],
         _currentUrl: 'http://localhost:3000/modules/medication-options/get-med-options' },
      [Symbol(outHeadersKey)]: { accept: [Array], 'user-agent': [Array], host: [Array] } },
   response:
    { status: 401,
      statusText: 'Unauthorized',
      headers:
       { 'x-powered-by': 'Express',
         'www-authenticate': 'Basic',
         'content-type': 'text/html; charset=utf-8',
         'content-length': '0',
         etag: 'W/"0-2jmj7l5rSw0yVb/vlWAYkK/YBwk"',
         date: 'Tue, 04 Jun 2019 14:29:49 GMT',
         connection: 'close' },
      config:
       { adapter: [Function: httpAdapter],
         transformRequest: [Object],
         transformResponse: [Object],
         timeout: 0,
         xsrfCookieName: 'XSRF-TOKEN',
         xsrfHeaderName: 'X-XSRF-TOKEN',
         maxContentLength: -1,
         validateStatus: [Function: validateStatus],
         headers: [Object],
         method: 'get',
         url: 'http://localhost:3000/modules/medication-options/get-med-options',
         responseType: 'json',
         data: undefined },
      request:
       ClientRequest {
         domain: null,
         _events: [Object],
         _eventsCount: 6,
         _maxListeners: undefined,
         output: [],
         outputEncodings: [],
         outputCallbacks: [],
         outputSize: 0,
         writable: true,
         _last: true,
         upgrading: false,
         chunkedEncoding: false,
         shouldKeepAlive: false,
         useChunkedEncodingByDefault: false,
         sendDate: false,
         _removedConnection: false,
         _removedContLen: false,
         _removedTE: false,
         _contentLength: 0,
         _hasBody: true,
         _trailer: '',
         finished: true,
         _headerSent: true,
         socket: [Object],
         connection: [Object],
         _header: 'GET /modules/medication-options/get-med-options HTTP/1.1\r\nAccept: application/json, text/plain, */*\r\nUser-Agent: axios/0.18.0\r\nHost: localhost:3000\r\nConnection: close\r\n\r\n',
         _onPendingData: [Function: noopPendingOutput],
         agent: [Object],
         socketPath: undefined,
         timeout: undefined,
         method: 'GET',
         path: '/modules/medication-options/get-med-options',
         _ended: true,
         res: [Object],
         aborted: undefined,
         timeoutCb: null,
         upgradeOrConnect: false,
         parser: null,
         maxHeadersCount: null,
         _redirectable: [Object],
         [Symbol(outHeadersKey)]: [Object] },
      data: '' } }
@austinstarin austinstarin removed their assignment Nov 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants