Misunderstood step forest/authentication using Nestjs, Mongoose, and Agent

:wave: Hello dear community

I come to you because I have followed the guide On NestJS to perform the implementation in my project with Nestjs.

However, what seems to be an almost completed configuration, I am running into the problem of the post to the authentication path that forest admin makes to /forest/authentication to my API.

At first, I was dealing with this quite a bit until I decided to create this path in my project (I created the route, and controller that receives this request); however, now I don’t know which thread to pull, since forest admin already finds the path, but I still don’t know what to do with the process of the request being made to this path.

I would like to please get a hand.

Failure Logs

Application is running on: http://[::1]:3000
{ body: { renderingId: '240889' } }


My implementation


  • Project name: wallet-testing
  • Team name: Operations
  • Environment name: Production
  • Agent (forest package) "@forestadmin/agent": "^1.36.12", "@forestadmin/datasource-mongoose": "^1.5.32",
  • Database type: MongoDB "mongoose": "^7.6.8",

I’m using Ngrok to receive the requests from my localhost

Hi and welcome to forest,
You don’t need to add a new route on your project for the authentication. It’s already implement on our agent.
The line 54 is listening the server before to start the agent. It’s probably your problem. Please can you move the line 54 after the start :pray:?

Tells me if my answer helps you.

Hi Alban_Bertolini, many thanks for your reply…

Almost done, now I was able to continue and I’m here:

this loading page has been like this for 2 hours, any idea what can I do?

Some logs of my deploy test:


Did you tried to reload your page?

Yes! just now and nothing

Are you still blocked?

yes, the load page is sitll active

I can see three environments, production, QA, and development. Which one is your?
If its development, can you restart your server again please?

This one wallet-testing → Production

Please can you add a customization that update the forestadmin-schema to try to unlock the build? For example, addField?

However, in the QA environment, I get this result:

On the Production environment, it continues with the load page.

I’m using Prisma, with Mongo setup

Please can you add a customization that update the forestadmin-schema to try to unlock the build? For example, addField?

I thought this was done automatically, that is, when creating the agent and connecting it to the database, the configuration of the collections would be created automatically

Yes it is, but I don’t know why but your build seems broken. The addField allows you to add a “computed field”/ “virtual field” like the full name in the example. I want to force the rebuild, by changing something from your side.
How do you push your code in production?

I’m using Docker with fl0 to launch my testing app

When change the NODE_ENV to the “production” value in my setup, I get this error:

In production mode you must have the .forestadmin-schema.json in your source due to performance reasons! In development mode the schema is built at each agent start. By default the schema is generated in your root. If you want to customize the path you should path the schemaPath option to your agent.
Your have this error because you probably don’t have the .forestadmin-schema.json.

This problem was solved by adding the files to the image


Please can you add a customization that update the forestadmin-schema to try to unlock the build? For example, addField?

However I added this field, but when I try to raise my local environment, it crashes.

Are you still blocked without adding field?

Yes! And I’m not sure because I’m using Prisma to define my models…

has anything to do with it? if I use

import { createMongooseDataSource } from '@forestadmin/datasource-mongoose';

shouldn’t I use something like datasource-prisma? if it exists? I can’t find any reference to that.

When I choose this

further on it tells me to install

npm install @forestadmin/agent @forestadmin/datasource-sql

:frowning: but I’m supposed to be using Mongoose

Does Prisma only support MySQL?