Update 2 hours later: Same project I go to from the Projects list page I get a popup that says " Unable to authenticate you" with further text below in orange: “Please verify that your admin backend is correctly configured and running, and that you have access to the internet.”
It should automatically detect that I ran the server.
Update: It should authenticate me when I have the project running and I open the Project page to view the admin panel.
Actual behavior
It gets stuck on “Waiting for your backend to run” with the green dot blinking.
Update: I get a popup that says " Unable to authenticate you" with further text below in orange: “Please verify that your admin backend is correctly configured and running, and that you have access to the internet.”
Hi @Mshary_AlSharekh !
Can you check on your browser logs if any other request is failing ?
There should be two call to /forest/authentication, one of them should be an OPTION call, does it fail too ?
I did all this using the datasource type “Express / Sequelize”. This is because it’s best and most ideal and convenient for me to have it as part of my existing express project.
I just tried creating a new project using the datasource type “PostgreSQL”, and followed the instructions. It worked without a hitch. So I may end up going that route, but I still would like it if the setup with my existing project would work, it would simplify my workflow.
I don’t know how relevant this is to this discussion, but I thought I should share it.
Did you follow all the instructions of the installation process ? It might be a problem with your CORS config still, did you exclude all the /forest route from your app cors config ?
Access to fetch at 'http://localhost:8000/forest/authentication' from origin 'https://app.forestadmin.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
POST http://localhost:8000/forest/authentication net::ERR_FAILED
It looks like you don’t have the specific cors exeption that needs to be implemented for the /forest/authentication route, see this code:
let allowedOrigins = [/\.forestadmin\.com$/, /localhost:\d{4}$/];
if (process.env.CORS_ORIGINS) {
allowedOrigins = allowedOrigins.concat(process.env.CORS_ORIGINS.split(','));
}
const corsConfig = {
origin: allowedOrigins,
maxAge: 86400, // NOTICE: 1 day
credentials: true,
};
app.use('/forest/authentication', cors({
...corsConfig,
// The null origin is sent by browsers for redirected AJAX calls
// we need to support this in authentication routes because OIDC
// redirects to the callback route
origin: corsConfig.origin.concat('null')
}));
app.use(cors(corsConfig));