MushroomMaula / fastapi_login

FastAPI-Login tries to provide similar functionality as Flask-Login does.
https://pypi.org/project/fastapi-login
MIT License
639 stars 58 forks source link

Error in "simple" example : /auth/register HTTP/1.1" 422 Unprocessable Entity #95

Closed marc-odp closed 1 year ago

marc-odp commented 1 year ago

The simple example index.html should be corrected like this

    // send data to the backend route
    fetch("/auth/register", {
      method: "POST",
      body: JSON.stringify(object)

becomes

  // send data to the backend route
    fetch("/auth/register", {
      method: "POST",
      body: JSON.stringify(object),
      headers: { 'Content-Type': 'application/json' }

See this link for details https://github.com/tiangolo/fastapi/issues/3373