Change password
POST
/password/change
const url = 'https://auth.timetonic.com/api/password/change';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"current_password":"example","password":"example","password_confirmation":"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://auth.timetonic.com/api/password/change \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "current_password": "example", "password": "example", "password_confirmation": "example" }'Change password for authenticated user. Accepts a Bearer token OR a portal session cookie (OidcBearerOrSession middleware). Also requires the verified (email verification) middleware — returns 403 if the user’s email is not verified.
Authorizations
Section intitulée « Authorizations »Request Bodyrequired
Section intitulée « Request Bodyrequired »Media typeapplication/json
object
current_password
required
string format: password
password
required
string format: password
password_confirmation
required
string format: password
Examplegenerated
{ "current_password": "example", "password": "example", "password_confirmation": "example"}Responses
Section intitulée « Responses »Password changed successfully
Media typeapplication/json
object
success
boolean
message
string
Example
{ "success": true}Authentication required or failed
Media typeapplication/json
object
success
boolean
error
string
message
string
Example
{ "success": false, "error": "unauthorized", "message": "Authentication required"}Email not verified (verified middleware)
Validation error
Media typeapplication/json
object
success
boolean
error
string
message
string
errors
object
key
additional properties
Array<string>
Example
{ "success": false, "error": "validation_error", "message": "The given data was invalid", "errors": { "email": [ "The email field is required." ] }}