Fwitter demo unauthorized

I downloaded GitHub - fauna-labs/fwitter: Fwitter is an example application that demonstrates the features and functionality of Fauna.. Set the REACT_APP_LOCAL___ADMIN to the admin key of my DB in .env.local which I renamed from .env.local.example :

npm run setup

> fwitter@0.1.0 setup
> node -r esm ./scripts/setup.js local

1.  -- Collections and Indexes -- Creating collections
   [ Failed  ] 'accounts collection', with error: [Unauthorized: unauthorized] {
  description: 'Unauthorized',
  requestResult: RequestResult {
    method: 'POST',
    path: '',
    query: null,
    requestRaw: '{"if":{"exists":{"collection":"accounts"}},"then":true,"else":{"create_collection":{"object":{"name":"accounts"}}}}',
    requestContent: Expr { raw: [Object] },
    responseRaw: '{"errors":[{"code":"unauthorized","description":"Unauthorized"}]}',
    responseContent: { errors: [Array] },
    statusCode: 401,
    responseHeaders: [Object: null prototype] {
      ':status': 401,
      'www-authenticate': 'Basic realm="Unauthorized"',
      'x-txn-time': '1654778094801210',
      'x-faunadb-build': '220606.221709-701b8fc',
      'content-length': '65',
      'content-type': 'application/json;charset=utf-8',
      [Symbol(nodejs.http2.sensitiveHeaders)]: []
    },
    startTime: 1654778094732,
    endTime: 1654778094830
  }
}

Any ideas?

Hi hunp!

Is your database in the Classic region group? If not, you need to specific the appropriate domain when setting up the Fauna client object.

This is a common oversight, and is easy to fix (assuming the region group is the problem). We are working towards a solution where the default domain works for any region group, but it is not close enough to completion for an ETA.

indeed. I was in US. Thx

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.