Skip to main content
POST
/
auth
/
setpassword
Set Password
curl --request POST \
  --url https://server26-dot-royalti-project.uc.r.appspot.com/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": "user@example.com",
      "firstName": "John",
      "lastName": "Doe",
      "isEmailVerified": true
    }
  }
}
This endpoint requires authentication. Include your Bearer token in the Authorization header.

Code Examples

const response = await fetch('https://server26-dot-royalti-project.uc.r.appspot.com/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);

Authorizations

Authorization
string
header
required

JWT Authorization header using the Bearer scheme. Format: "Bearer {token}"

Body

application/json
password
string
required

The new password to be set

Minimum length: 8
Example:

"securePassword123!"

Response

Password set successfully

token
string

JWT access token

refreshToken
string

Refresh token for getting new access tokens

user
object