curl --request POST \
--url https://api.royalti.io/auth/setpassword \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"password": "securePassword123!"
}
'{
"success": true,
"message": "Password set successfully",
"data": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"user": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"email": "[email protected]",
"firstName": "John",
"lastName": "Doe",
"isEmailVerified": true
}
}
}Sets a new password for a user after they have verified their email.
curl --request POST \
--url https://api.royalti.io/auth/setpassword \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"password": "securePassword123!"
}
'{
"success": true,
"message": "Password set successfully",
"data": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"user": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"email": "[email protected]",
"firstName": "John",
"lastName": "Doe",
"isEmailVerified": true
}
}
}const response = await fetch('https://api.royalti.io/auth/setpassword', {
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
"password": "securePassword123!"
})
});
const data = await response.json();
console.log(data);
JWT Authorization header using the Bearer scheme. Format: "Bearer {token}"
The new password to be set
8"securePassword123!"