# Unauthorized app / \[object Object\]

**URL:** <https://community.forestadmin.com/t/unauthorized-app-object-object/2158>\
**Category:** Help me!\
**Created:** [March 23, 2021, 4:34pm UTC](https://community.forestadmin.com/t/unauthorized-app-object-object/2158 "2021-03-23T16:34:52Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Antoine007](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/antoine007/32/1843_2.png) [@Antoine007](https://community.forestadmin.com/u/Antoine007)\
**Post date:** [March 23, 2021, 4:34pm UTC](https://community.forestadmin.com/t/unauthorized-app-object-object/2158/1 "2021-03-23T16:34:52Z")

</div>

## Data in forest admin not working!

Upgrading to v7. Got the forest\_client\_id. Working fine locally. Deploying to heroku.

## Actual behavior

401 when loading the app. The app only responds [object Object]  
500 in forest itself

## Failure Logs

 ![Screenshot 2021-03-23 at 15.43.25](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/3/3bc0f2ffdec59ca65685108c0408d2d34eae1f05.png) ![Screenshot 2021-03-23 at 15.44.18](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/f/ff9bcd62834353c9c54bbab8c337d6f538175408.png)

## Context

- Package Version: 7.2.2
- Express Version: 4.17
- Sequelize Version:
- Database Dialect: pg
- Database Version: 8.5.1
- Project Name: carl-forest

---

<div class="post-metadata">

**Author:** ![anon37102731](https://avatars.discourse-cdn.com/v4/letter/a/c6cbf5/32.png) [@anon37102731](https://community.forestadmin.com/u/anon37102731)\
**Post date:** [March 23, 2021, 4:44pm UTC](https://community.forestadmin.com/t/unauthorized-app-object-object/2158/2 "2021-03-23T16:44:31Z")

</div>

Hi @Antoine007,

Thank you for sharing your issue with us.

Could you confirm that your staging environment contains an `APPLICATION_URL` entry set with your remote environment URL? (`https://carl-forest-staging.herokuapp.com`)

---

<div class="post-metadata">

**Author:** ![Antoine007](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/antoine007/32/1843_2.png) [@Antoine007](https://community.forestadmin.com/u/Antoine007)\
**Post date:** [March 23, 2021, 4:49pm UTC](https://community.forestadmin.com/t/unauthorized-app-object-object/2158/3 "2021-03-23T16:49:32Z")

</div>

Yes sir!  
[Screenshot 2021-03-23 at 16.49.05|634x238](https://community.forestadmin.com/uploads/short-url/pJVmMlSxMYlbqk6gg9Mska3lLVJ.png)

---

<div class="post-metadata">

**Author:** ![anon37102731](https://avatars.discourse-cdn.com/v4/letter/a/c6cbf5/32.png) [@anon37102731](https://community.forestadmin.com/u/anon37102731)\
**Post date:** [March 23, 2021, 4:54pm UTC](https://community.forestadmin.com/t/unauthorized-app-object-object/2158/4 "2021-03-23T16:54:43Z")

</div>

Could you also try to log out and log back in again?

Also when you say that your `The app only responds [object Object]` what do you mean exactly?

Last thing that could help would be a screen record of your experience trying to access the project (using [Loom](https://www.loom.com/) for example)

---

<div class="post-metadata">

**Author:** ![Antoine007](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/antoine007/32/1843_2.png) [@Antoine007](https://community.forestadmin.com/u/Antoine007)\
**Post date:** [March 23, 2021, 5:03pm UTC](https://community.forestadmin.com/t/unauthorized-app-object-object/2158/5 "2021-03-23T17:03:49Z")

</div>

Logging out does nothing.  
[object Object] is the reposne when I query the node app from the browser (the url that forest queries to get the data and gets a 500 on)

Does this work?

> **[Screen Recording 2021-03-23 at 17.00.10.mov](https://wetransfer.com/downloads/a65cfc77b3b5c9d6730b5c2858465dc420210323170203/7c7a3e9461b665af54c8e403f2ed45d520210323170229/d90728)**
>
> 1 file sent via WeTransfer, the simplest way to send your files around the world

---

<div class="post-metadata">

**Author:** ![anon37102731](https://avatars.discourse-cdn.com/v4/letter/a/c6cbf5/32.png) [@anon37102731](https://community.forestadmin.com/u/anon37102731)\
**Post date:** [March 23, 2021, 5:09pm UTC](https://community.forestadmin.com/t/unauthorized-app-object-object/2158/6 "2021-03-23T17:09:02Z")

</div>

It works well @Antoine007, thank you.

It looks like that the calls from the frontend to your staging API is returning a 500 error, can you share with me the content of the answer (and there should probably be error logs on your API server related to this 500 error).

Thank you

---

<div class="post-metadata">

**Author:** ![Antoine007](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/antoine007/32/1843_2.png) [@Antoine007](https://community.forestadmin.com/u/Antoine007)\
**Post date:** [March 23, 2021, 5:14pm UTC](https://community.forestadmin.com/t/unauthorized-app-object-object/2158/7 "2021-03-23T17:14:15Z")

</div>

the errors are the ones in the first post + this

 ![Screenshot 2021-03-23 at 17.13.35](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/3/3d750bce35709f7beae37787259d0a34d2a5d95e.png)

---

<div class="post-metadata">

**Author:** ![Antoine007](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/antoine007/32/1843_2.png) [@Antoine007](https://community.forestadmin.com/u/Antoine007)\
**Post date:** [March 23, 2021, 5:19pm UTC](https://community.forestadmin.com/t/unauthorized-app-object-object/2158/8 "2021-03-23T17:19:17Z")

</div>

I have env `DATABASE_REJECT_UNAUTHORIZED` and `DATABASE_SSL = true`. Is that right?

---

<div class="post-metadata">

**Author:** ![GuillaumeGautreau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/guillaumegautreau/32/557_2.png) [@GuillaumeGautreau](https://community.forestadmin.com/u/GuillaumeGautreau)\
**Post date:** [March 24, 2021, 7:48am UTC](https://community.forestadmin.com/t/unauthorized-app-object-object/2158/9 "2021-03-24T07:48:47Z")

</div>

Hello @Antoine007,

The logs say that the agent is refusing to connect to your database because of the error `DEPTH_ZERO_SELF_SIGNED_CERT` which indicates that your DB uses a self-signed certificate that cannot be validated.

If it’s normal and if you don’t plan to use a properly signed certificate, you can set the option `DATABASE_REJECT_UNAUTHORIZED` to `false`.

In this case, it will **not** reject (thus it will accept) invalid certificates.

---

<div class="post-metadata">

**Author:** ![Antoine007](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/antoine007/32/1843_2.png) [@Antoine007](https://community.forestadmin.com/u/Antoine007)\
**Post date:** [March 24, 2021, 10:34am UTC](https://community.forestadmin.com/t/unauthorized-app-object-object/2158/10 "2021-03-24T10:34:55Z")

</div>

toggling it doesn’t fix it. Same error.  
I have

```javascript
if (
  process.env.DATABASE_SSL &&
  JSON.parse(process.env.DATABASE_SSL.toLowerCase())
) {
  if (process.env.DATABASE_REJECT_UNAUTHORIZED === false) {
    databaseOptions.dialectOptions.ssl = {
      rejectUnauthorized: false,
      require: true,
    };
  } else {
    databaseOptions.dialectOptions.ssl = true;
  }
}

```

in the models/index.js Is that right?

---

<div class="post-metadata">

**Author:** ![GuillaumeGautreau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/guillaumegautreau/32/557_2.png) [@GuillaumeGautreau](https://community.forestadmin.com/u/GuillaumeGautreau)\
**Post date:** [March 24, 2021, 10:55am UTC](https://community.forestadmin.com/t/unauthorized-app-object-object/2158/11 "2021-03-24T10:55:50Z")

</div>

Hi @Antoine007,

Can you try to change this code into

```javascript
// Add quotes around false here, because env variables
// are strings
if (process.env.DATABASE_REJECT_UNAUTHORIZED === "false") {
    databaseOptions.dialectOptions.ssl = {
      rejectUnauthorized: false,
      require: true,
    };
  } else {
    databaseOptions.dialectOptions.ssl = true;
  }

```

To test if it works better?

This generated code has been changed in more recent versions of lumber to address this issue, but your project seem to have been generated with an older version of lumber.

---

<div class="post-metadata">

**Author:** ![Antoine007](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/antoine007/32/1843_2.png) [@Antoine007](https://community.forestadmin.com/u/Antoine007)\
**Post date:** [March 24, 2021, 11:05am UTC](https://community.forestadmin.com/t/unauthorized-app-object-object/2158/12 "2021-03-24T11:05:08Z")

</div>

Thanks, that did it.
