parse-community / docs

Parse Platform docs
https://docs.parseplatform.org
Other
313 stars 517 forks source link

Endpoint `loginAs` is falsely documented to require GET request #895

Closed aclec closed 2 years ago

aclec commented 2 years ago

New Issue Checklist

Issue Description

I'm trying to log by REST API with /loginAs and the answer is "Cannot GET /parse/loginAs". But it's working with POST request. Is it just an error in the documentation ?

Steps to reproduce

Make GET request on /loginAs like it's write on documentation.

Environment

Server

Database

parse-github-assistant[bot] commented 2 years ago

Thanks for opening this issue!

mtrezza commented 2 years ago

A log-in method always has to be a POST request, because it's not idempotent. If you look at the code, it's correctly implemented as a POST route:

https://github.com/parse-community/parse-server/blob/4c29d4d23b67e4abaf25803fe71cae47ce1b5957/src/Routers/UsersRouter.js#L481-L483

Where in the docs did you read that a GET request should be used?

aclec commented 2 years ago

@mtrezza on the Rest api doc: https://docs.parseplatform.org/rest/guide/#user-impersonation

mtrezza commented 2 years ago

I transferred the issue to the docs repo. Would you mind opening a PR to correct the docs?

aclec commented 2 years ago

Sure, I'll do that

mtrezza commented 2 years ago

Closing via #897