Change or set password
POST
/_torii/auth/change-password
const url = 'https://your-app.torii.so/_torii/auth/change-password';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"currentPassword":"example","newPassword":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://your-app.torii.so/_torii/auth/change-password \ --header 'Content-Type: application/json' \ --data '{ "currentPassword": "example", "newPassword": "example" }'Changes the current user’s password. If the user has no password yet (OAuth-only account), currentPassword may be omitted and a password-enabled email identity is created.
Request Body required
Section titled “Request Body required ” Media type application/json
Payload for changing or setting the current user’s password
object
currentPassword
Current password. Required when the user already has a password. Omit or send null when the user is setting a password for the first time (e.g. OAuth-only account).
string | null
newPassword
required
string
Example generated
{ "currentPassword": "example", "newPassword": "example"}Responses
Section titled “ Responses ”OK
Media type application/json
object
Example generated
{}