ember-nexus / api

Knowledge Graph API
https://ember-nexus.github.io/api
GNU Affero General Public License v3.0
9 stars 1 forks source link

Rework `POST /change-password` endpoint to make it simpler #280

Closed Syndesi closed 2 months ago

Syndesi commented 2 months ago

The POST /change-password endpoint is currently using the following request body scheme:

{
  "type": "ActionChangePassword",
  "currentPassword": "1234",
  "newPassword": "9876",
  "data": {
    "<identifier>": "test@example.com"
  }
}

The user identifier at data.<identifier> is not really intuitive, especially because no other properties within data will be used anyways. Furthermore, as <identifier> depends on the instance's configuration, it is unknown without executing GET /instance-configuration as well, making the current implementation both unintuitive as well as hard to use.

The current solution was developed during #121 .

The proposed solution is as following:

{
  "type": "ActionChangePassword",
  "currentPassword": "1234",
  "newPassword": "9876",
  "uniqueUserIdentifier": "test@example.com"
}

Tasks