Random 401 errors while logging on to the dashboard

It seems Fauna and Auth0 integration is broken for the last few days.
Also, I got a lot of random errors from the dashboard.
What happening with Fauna? Are you closing the business?

Hi Daniel,

Just to reassure you, no, we are not closing the business. Errors can happen at times, and we’ll work with you to get them resolved. But I promise, we’re not going anywhere.

From the information you provided in the community Slack it looks like this might be a driver version incompatibility between Fauna and Auth0. We’re working with our peers at Auth0 to get this resolved now. I’ll update when we know more.

Cory

OK. But it still does not work, so please downgrade my Team subscription to Individual, thank you.

I think it’s probably related to some changes recently made to driver, because it works randomly. I don’t think Fauna itself is broken. For the record, this is Auth0 rule code:

function saveUser(user, context, callback) {
  const Fauna = require('faunadb@4.1.1');
  const { query } = Fauna;
  const {
    Create,
    Collection,
    Now,
    Exists,
    Match,
    Index,
    If,
    Update,
    Let,
    Var,
    Select,
    Get,
  } = query;

  const _ = require('lodash');

  let userPicture = user.picture;

  if (context.connection === 'facebook') {
    const fbIdentity = _.find(user.identities, { connection: 'facebook' });
    // for more sizes and types of images that can be returned, see:
    // https://developers.facebook.com/docs/graph-api/reference/user/picture/
    const pictureType = 'large';
    userPicture =
      'https://graph.facebook.com/v2.5/' +
      fbIdentity.user_id +
      '/picture?type=' +
      pictureType;
  }

  const client = new Fauna.Client({
    secret: configuration.Fauna_SERVER_KEY,
  });

  client
    .query(
      Let(
        {
          user: Match(Index('usersByAuth0UserId'), user.user_id),
        },
        If(
          Exists(Var('user')),
          Update(Select('ref', Get(Var('user'))), {
            data: {
              email: user.email,
              facebook: {
                picture: userPicture,
                picture_large: user.picture_large,
              },
            },
          }),
          Create(Collection('users'), {
            data: {
              createdAt: Now(),
              auth0UserId: user.user_id,
              email: user.email,
              name: user.name.trim().slice(0, 64),
              facebook: {
                picture: userPicture,
                picture_large: user.picture_large,
              },
            },
          }),
        ),
      ),
    )
    .then(
      () => {
        callback(null, user, context);
      },
      (error) => {
        console.log(error);
        callback(null, user, context);
      },
    );
}

Meanwhile, I decided I don’t want my app to depend on Auth0. The platform, which does not allow me the code I need is a no-go for my use case. Also, the pricing.

Hi Daniel,

Thanks for the code example. We’ll see if we can reproduce the issue. We’re also working with the team at Auth0 to get to a resolution.

Fyi, if you’re on the Team plan, you have access to professional support at support.fauna.com. We’ll keep working with you here but in case anything else were to come up that you needed a quicker response on that’s the way to go.

Cory

1 Like

Hey, i’ve just ran onto 401s too I can’t seem to resolve - just updated my client to hit a region specific domain after creating an eu-specific db. Not a paying customer so wondering if there are any additional details that can be provided here? Have these issues been resolved?

Is there a way to know if the auth0 integration is currently broken? I keep trying to signup up for slack but I never get the invite email.

@Stephanos_T Fauna is not responsible for the auth integration between Slack and your auth provider (google, etc.). If there’s something wrong there, Fauna will not be able to help.

The original post was about logging in to dashboard.fauna.com. If you are having problems logging in to the dashboard, I think a new topic with more details about your situation would be best.

Cheers!

@stephanos7 This topic was created before region groups. Similar to the last post, I think that a new topic with the details of your situation would be appropriate.

Also, see this post about connecting to Region Groups.

Cheers!

The title and tags have been updated to reflect the original topic.