46 lines
1.0 KiB
HTTP
46 lines
1.0 KiB
HTTP
### Register User
|
|
POST http://localhost:8080/api/v1/auth/register
|
|
Content-Type: application/json
|
|
|
|
{
|
|
"firstname": "Ali",
|
|
"lastname": "Bouali",
|
|
"email": "alibou@mail.com",
|
|
"password": "password",
|
|
"role": "ADMIN"
|
|
}
|
|
|
|
> {% client.global.set("auth-token", response.body.access_token); %}
|
|
|
|
### Query the Demo endpoint
|
|
GET http://localhost:8080/api/v1/demo-controller
|
|
Authorization: Bearer {{auth-token}}
|
|
|
|
|
|
### Change the password
|
|
PATCH http://localhost:8080/api/v1/users
|
|
Content-Type: application/json
|
|
Authorization: Bearer {{auth-token}}
|
|
|
|
{
|
|
"currentPassword": "password",
|
|
"newPassword": "newPassword",
|
|
"confirmationPassword": "newPassword"
|
|
}
|
|
|
|
### Login again and update the token
|
|
POST http://localhost:8080/api/v1/auth/authenticate
|
|
Content-Type: application/json
|
|
|
|
{
|
|
"email": "alibou@mail.com",
|
|
"password": "newPassword"
|
|
}
|
|
|
|
> {% client.global.set("new-auth-token", response.body.access_token); %}
|
|
|
|
|
|
### Query the Demo endpoint after password change
|
|
GET http://localhost:8080/api/v1/demo-controller
|
|
Authorization: Bearer {{new-auth-token}}
|