Skip to content

Commit 8c02cbf

Browse files
changes moreee email
1 parent c830f00 commit 8c02cbf

File tree

6 files changed

+25
-2439
lines changed

6 files changed

+25
-2439
lines changed

README.md

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ A full-stack web application for managing lost and found items at **Thapar Insti
6666
- **MongoDB** - NoSQL database
6767
- **Mongoose 8.19.3** - ODM for MongoDB
6868
- **Redis (ioredis 5.8.2)** - Caching & session management
69-
- **JWT** - Authentication
70-
- **bcryptjs** - Password hashing
69+
- **JWT** - Authentication tokens
70+
- **Google OAuth 2.0** - Secure authentication via Thapar email
7171
- **Helmet** - Security headers
7272
- **CORS** - Cross-origin resource sharing
7373
- **Morgan** - HTTP request logger
@@ -151,10 +151,12 @@ This creates:
151151
- 15 sample items
152152
- 3 pending claims
153153

154-
**Default Test Credentials:**
154+
**Default Test Users:**
155155

156-
- **Admin**: admin@thapar.edu / admin123
157-
- **User**: john.doe@thapar.edu / password123
156+
- **Admin**: admin@thapar.edu (Google OAuth)
157+
- **User**: john.doe@thapar.edu (Google OAuth)
158+
159+
_Note: Authentication is via Google OAuth using @thapar.edu emails only_
158160

159161
### 5. Run the Application
160162

@@ -225,7 +227,6 @@ softwareProject/
225227
│ │ ├── pages/ # Page components
226228
│ │ │ ├── Home.jsx
227229
│ │ │ ├── login.jsx
228-
│ │ │ ├── signup.jsx
229230
│ │ │ ├── admin.jsx
230231
│ │ │ └── Claim_items.jsx
231232
│ │ ├── context/ # React Context
@@ -240,7 +241,8 @@ softwareProject/
240241

241242
## 🔐 Authentication & Authorization
242243

243-
- **JWT-based authentication** with HTTP-only cookies
244+
- **Google OAuth 2.0 authentication** with @thapar.edu email restriction
245+
- **JWT-based sessions** with HTTP-only cookies
244246
- **Token expiry**: 1 hour
245247
- **Admin privileges** must be manually set in the database
246248
- **Protected routes** for user claims and admin dashboard
@@ -273,7 +275,8 @@ System auto-rejects other claims → Notify users
273275

274276
- Email (must be @thapar.edu)
275277
- Name, Roll Number
276-
- Password (hashed with bcrypt)
278+
- Google ID
279+
- Profile Picture (Google)
277280
- isAdmin flag
278281

279282
### Item
@@ -311,8 +314,9 @@ COS, Library, LT, near HOSTEL O C D M, near HOSTEL A B J H, near HOSTEL Q PG, ne
311314

312315
## 🛡️ Security Features
313316

314-
- Password hashing with bcryptjs
317+
- Google OAuth 2.0 integration
315318
- JWT token authentication
319+
- @thapar.edu email domain restriction
316320
- HTTP-only cookies
317321
- Helmet.js for security headers
318322
- CORS protection
@@ -334,8 +338,10 @@ Detailed API documentation is available in `backend/API_DOCUMENTATION.md`
334338
**Key Endpoints:**
335339

336340
- `GET /api/user/items` - Browse items (public, cached)
337-
- `POST /api/auth/signup` - Create account (rate limited: 50/15min)
338-
- `POST /api/auth/login` - Login (rate limited: 50/15min)
341+
- `GET /api/auth/google` - Initiate Google OAuth
342+
- `GET /api/auth/google/callback` - OAuth callback
343+
- `POST /api/auth/logout` - Logout user
344+
- `GET /api/auth/profile` - Get current user profile
339345
- `POST /api/user/items/:id/claim` - Claim item (rate limited: 10/hour, idempotent)
340346
- `GET /api/user/my-claims` - View my claims (cached)
341347
- `POST /api/admin/items` - Create item (admin, cache invalidation)
@@ -369,7 +375,7 @@ Creates admin@thapar.edu / admin123
369375

370376
### Method 2: Manual Setup
371377

372-
1. Sign up normally through the UI
378+
1. Login with your @thapar.edu Google account through the UI
373379
2. Connect to MongoDB
374380
3. Run:
375381

0 commit comments

Comments
 (0)