parse-dashboard icon indicating copy to clipboard operation
parse-dashboard copied to clipboard

Cannot POST /login using latest version

Open andresteves opened this issue 3 years ago • 11 comments

New Issue Checklist

Issue Description

Setup new server with latest parse-server and parse-dashboard results in the below screenshot error.

Latest version of dashboard Captura de ecrã 2022-03-16, às 15 35 27

I am using express and the using the following to init parse-dashboard:

var dashboard = new ParseDashboard({
  "apps":dashboards,
  "iconsFolder": "icons",
  "users": [
    {
      "user":"username",
      "pass":"password"
    }
  ],
  "useEncryptedPasswords": false,
  "trustProxy": 1
},true);

var app = express();
app.use(helmet());
app.set('view engine', 'pug');
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.use('/parse', api);
console.log(servers[0]);
for (var i = 0; i < servers.length; i++) {
    //Add clients
  app.use('/parse', servers[i]);
}

app.use('/dashboard/', dashboard);

dashboards above is an array of objects.

Steps to reproduce

Actual Outcome

I see Cannot POST /login

Expected Outcome

Dashboard apps shown

Environment

├── @parse/[email protected] ├── @parse/[email protected] ├── @parse/[email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] └── [email protected]

Dashboard

  • Parse Dashboard version: 4.0.1
  • Browser (Safari, Chrome, Firefox, Edge, etc.): Safari, Brave
  • Browser version: 1.36.112 Chromium: 99.0.4844.51](https://brave.com/latest/)

Server

  • Parse Server version: 5.0.0
  • Operating system: Debian 10
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): Local

Database

  • System (MongoDB or Postgres): MongoDB
  • Database version: 5.0.0
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): Local

Logs

andresteves avatar Mar 16 '22 18:03 andresteves

Thanks for opening this issue!

  • 🚀 You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.

Thanks for opening the issue? Does it happen when you open the dashboard? Or after trying to log in?

davimacedo avatar Mar 16 '22 20:03 davimacedo

After trying to login only. The login form is displayed correctly.

andresteves avatar Mar 16 '22 20:03 andresteves

@andresteves It seems you are using an very old version of Parse Dashboard.

In the issue description you indicated that you can reproduce the issue with the latest versions of Parse Server and Parse Dashboard and you indicate that you used Parse Dashboard 4.0.1. However in your screenshot it shows version 1.2.0. Could you clarify which version you were using?

mtrezza avatar Mar 16 '22 21:03 mtrezza

@mtrezza the version I am using is 4.0.1 and one of the screenshots is from the working version I have on another server. I will delete for the sake of not causing confusion.

andresteves avatar Mar 17 '22 09:03 andresteves

@mtrezza @davimacedo It was fixed after I changed app.use('/dashboard', dashboard); to app.use('/', dashboard);. Why is that? The mountPath needs to defined somewhere else as well?

andresteves avatar Mar 17 '22 11:03 andresteves

Yes. You need to set mountPath option.

davimacedo avatar Mar 17 '22 18:03 davimacedo

@andresteves Do you think there is something that should be improved in the docs?

mtrezza avatar Mar 17 '22 21:03 mtrezza

@mtrezza I believe so since by using express does not refer that I need to config mountPath within ParseDashboard constructor

andresteves avatar Mar 18 '22 10:03 andresteves

@andresteves Do you want to make a PR?

mtrezza avatar Mar 21 '22 19:03 mtrezza