Skip to content

Commit 4425d28

Browse files
committed
signin description fix
1 parent 089b1a4 commit 4425d28

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

week-3/04-mongo-with-jwt-auth/README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
## Create a course selling website
22

33
### Description
4+
45
Same as the last assignment but you need to use jwts for authentication.
56
We have introduced the signgin endpoints for both users and admins.
67
For this one, in every authenticated requests, you need to send the jwt in headers (Authorization : "Bearer <actual token>").
78
You need to use mongodb to store all the data persistently.
89

910
## Routes
11+
1012
### Admin Routes:
13+
1114
- POST /admin/signup
1215
Description: Creates a new admin account.
1316
Input Body: { username: 'admin', password: 'pass' }
1417
Output: { message: 'Admin created successfully' }
1518
- POST /admin/signin
16-
Description: Creates a new admin account.
19+
Description: Logs in an admin account.
1720
Input Body: { username: 'admin', password: 'pass' }
1821
Output: { token: 'your-token' }
1922
- POST /admin/courses
@@ -26,12 +29,13 @@ You need to use mongodb to store all the data persistently.
2629
Output: { courses: [ { id: 1, title: 'course title', description: 'course description', price: 100, imageLink: 'https://linktoimage.com', published: true }, ... ] }
2730

2831
### User routes
32+
2933
- POST /users/signup
3034
Description: Creates a new user account.
3135
Input: { username: 'user', password: 'pass' }
3236
Output: { message: 'User created successfully' }
3337
- POST /users/signin
34-
Description: Creates a new user account.
38+
Description: Logs in a user account.
3539
Input: { username: 'user', password: 'pass' }
3640
Output: { token: 'your-token' }
3741
- GET /users/courses
@@ -45,4 +49,4 @@ You need to use mongodb to store all the data persistently.
4549
- GET /users/purchasedCourses
4650
Description: Lists all the courses purchased by the user.
4751
Input: Headers: { 'Authorization': 'Bearer <your-token>' }
48-
Output: { purchasedCourses: [ { id: 1, title: 'course title', description: 'course description', price: 100, imageLink: 'https://linktoimage.com', published: true }, ... ] }
52+
Output: { purchasedCourses: [ { id: 1, title: 'course title', description: 'course description', price: 100, imageLink: 'https://linktoimage.com', published: true }, ... ] }

0 commit comments

Comments
 (0)