Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to test routes #11

Closed
shikhardb opened this issue Apr 22, 2020 · 2 comments
Closed

Unable to test routes #11

shikhardb opened this issue Apr 22, 2020 · 2 comments

Comments

@shikhardb
Copy link

shikhardb commented Apr 22, 2020

I am trying to test the /users routes with Postman, but it is returning 404.
Is there a list of the available routes?
I am trying this - GET localhost:3000/v1/users/getUsers/:userId , but it returns 404

@hagopj13
Copy link
Owner

@shikhardb you should instead use localhost:3000/v1/users/:userId
If you are logged in as admin (and are using the corresponding JWT token in the Authorization header), then you can get any user. If you are logged in as a user, then specifying any id for :userId other than yours will return a 403 error.

@hagopj13
Copy link
Owner

hagopj13 commented Apr 22, 2020

@shikhardb List of available routes (I will add them to the docs soon):
Auth routes:
POST /auth/register - register as a user
POST /auth/login - login
POST /auth/refresh-tokens - refresh access token
POST /auth/forgot-password - send a reset password email
POST /auth/reset-password - reset password

User routes:
POST /users - create a user
GET /users - get all users
GET /users/:userId - get a user with id=:userId
PATCH /users/:userId - update a user with id=:userId
DELETE /users/:userId - delete a user with id=:userId

The user routes mentioned above are only allowed for admins (since they have the getUsers and manageUsers permissions). Regular users can only use them if their id=:userId

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants