Change user password
AuthorizationBearer <token>
In: header
currentPasswordstring
newPasswordstring
Length
6 <= lengthResponse Body
curl -X PUT "http://localhost:3000/api/auth/change-password" \
-H "Content-Type: application/json" \
-d '{
"currentPassword": "string",
"newPassword": "string"
}'const body = JSON.stringify({
"currentPassword": "string",
"newPassword": "string"
})
fetch("http://localhost:3000/api/auth/change-password", {
body
})package main
import (
"fmt"
"net/http"
"io/ioutil"
"strings"
)
func main() {
url := "http://localhost:3000/api/auth/change-password"
body := strings.NewReader(`{
"currentPassword": "string",
"newPassword": "string"
}`)
req, _ := http.NewRequest("PUT", url, body)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "http://localhost:3000/api/auth/change-password"
body = {
"currentPassword": "string",
"newPassword": "string"
}
response = requests.request("PUT", url, json = body, headers = {
"Content-Type": "application/json"
})
print(response.text){
"message": "string"
}