Authentication Error

Thanks, I manage to make it work, I have changed few things in terms of initializing forest admin.

INSTEAD OF THIS

app.use(await forest.init({
envSecret: process.env.FOREST_ENV_SECRET,
authSecret: process.env.FOREST_AUTH_SECRET,
objectMapping: models,
connections: { default: connection },
}));

I DID THIS

forest.init({
    envSecret: process.env.FOREST_ENV_SECRET,
    authSecret: process.env.FOREST_AUTH_SECRET,
    objectMapping:require('mongoose'),
    connections: { default: mongooseConnection },
   }).then((FAMiddleware) => {
    app.use(FAMiddleware);
   });

INSTEAD OF THIS

app.use('/forest/authentication',cors(corsConfig)); // it returns status 404`

I DID THIS

app.post('/forest/authentication',cors(corsConfig)); // it returns status 200`
2 Likes