Users - adithya/image-repo GitHub Wiki

Register a new user

Endpoint GET /user/signup

Request:

curl --request GET \
  --url http://localhost:8080/user/signup \
  --header 'content-type: application/json' \
  --data '{ "username":"testuser", "password":"secret" }'

Response:

User created

Authenticate a new user

Endpoint GET /user/authenticate

Request:

curl -c /tmp/cookies \
  --request GET \
  --url http://localhost:8080/user/authenticate \
  --header 'content-type: application/json' \
  --data '{ "username":"testuser", "password":"secret" }'

Response:

Authentication successful

Refresh a token for a user

Endpoint GET /user/refresh

Request:

curl -c /tmp/cookies \
  -b /tmp/cookies \
  --request GET \
  --url http://localhost:8080/user/refresh

Response:

Log a user out

Endpoint GET /user/logout

Request:

curl -c /tmp/cookies \
  -b /tmp/cookies \
  --request GET \
  --url http://localhost:8080/user/logout

Response: