-
Notifications
You must be signed in to change notification settings - Fork 5
library upgrade #38
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
base: master
Are you sure you want to change the base?
library upgrade #38
Conversation
filter and location issue resolved
maphathon flow updated
add mapathon issue fix
mapathin date validation fixed
user schema updated
update user profile resolvedd
asian race added
forgot password link updated
resolve forgot password issues and activate user flow
replace remove function with delete one
resolve activation account issue
new fields added in user model lastLocation lastActivityTime and device
allow repeating names for events
- Add lastLogin, inactivityEmailSent, and inactivityEmailSentAt fields to User model - Update all authentication endpoints (sign-in, Google, Facebook, Apple) to track lastLogin - Add archived account check for OAuth logins (returns 403 with userId) - Create new /auth/reactivate-account endpoint for archived users - Support password reset and profile update during reactivation - Auto-login users after successful reactivation with JWT tokens - Prepare backend for Salesforce integration for inactivity email workflows
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request implements a comprehensive library upgrade and feature expansion for the application. The changes modernize deprecated MongoDB methods, enhance authentication with Apple Sign-In support, introduce new accessibility review fields, and add donation/subscription functionality.
Key Changes:
- Upgraded MongoDB methods from deprecated versions (
.remove(),.count(),mongoose.Types.ObjectId()) to current standards (.deleteOne(),.countDocuments(),new mongoose.Types.ObjectId()) - Added Apple Sign-In authentication alongside existing Google and Facebook authentication
- Expanded venue accessibility review system with new fields (wheelchair parking, washrooms, multiple floors, etc.)
- Implemented in-app purchase/subscription system with Apple and Google webhook support
Reviewed changes
Copilot reviewed 92 out of 117 changed files in this pull request and generated 22 comments.
Show a summary per file
| File | Description |
|---|---|
| src/scripts/db/*.js | Updated deprecated Mongoose methods to modern equivalents |
| src/routes/auth/*.js | Added Apple Sign-In, reactivation flow, and updated token expiration |
| src/routes/venues/*.js | Added new venue details endpoint and expanded accessibility fields |
| src/routes/reviews/*.js | Updated review system with new accessibility criteria |
| src/routes/donatins/*.js | New donation/subscription system with payment verification |
| src/routes/events/*.js | Added event filtering by status (upcoming, old, joined) |
| src/routes/users/*.js | Enhanced user profile with additional demographic fields |
| src/models/*.js | Added new schemas for surveys and donations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| return res.status(200).json({ general: "Joined" }); | ||
|
|
||
| if (true || event.isOpen) { | ||
| req.user.events = [...req.user.events, event.id]; | ||
| req.user.updatedAt = moment.utc().toDate(); | ||
|
|
||
|
|
||
|
|
||
| return res.status(200).json({ general: "Joined" }); | ||
| } else { |
Copilot
AI
Dec 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unreachable code detected. Lines 69-152 will never execute because of the return statement on line 67. The condition if (true || event.isOpen) on line 69 suggests this might be debugging code that was left in. Either remove the early return on line 67 or remove the unreachable code block.
|
|
||
| let placesResponse; | ||
| try { | ||
| console.log(`https://maps.googleapis.com/maps/api/place/${searchType}/json${nearbyParams}&fields=photos,place_id`) |
Copilot
AI
Dec 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debug console.log statement should be removed before merging to production. This appears to log API URLs which could expose sensitive query parameters.
| console.log(`https://maps.googleapis.com/maps/api/place/${searchType}/json${nearbyParams}&fields=photos,place_id`) |
| let places = []; | ||
| const placesIds = []; | ||
| placesResponse.data.results.forEach((place) => { | ||
| console.log(place?.photos) |
Copilot
AI
Dec 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debug console.log statement should be removed before merging to production.
| console.log(place?.photos) |
| placeId, | ||
| }); | ||
| let customReviews; | ||
| // console.log("venue", venue); |
Copilot
AI
Dec 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented-out debug code should be removed to keep the codebase clean.
| // console.log("venue", venue); |
| placesIds.push(place.place_id); | ||
| }); | ||
|
|
||
| // console.log("calling venues"); |
Copilot
AI
Dec 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented-out debug code should be removed to keep the codebase clean.
| // console.log("calling venues"); |
| token, | ||
| }); | ||
| } catch (err) { | ||
| console.log(err) |
Copilot
AI
Dec 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use console.error() instead of console.log() for error logging to properly categorize the log output.
| console.log(err) | |
| console.error(err); |
| refreshToken: refreshToken.key, | ||
| }); | ||
| } catch (err) { | ||
| console.log(err); |
Copilot
AI
Dec 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use console.error() instead of console.log() for error logging to properly categorize the log output.
| console.log(err); | |
| console.error(err); |
| return res.status(400).json({ message: "verification failed" }); | ||
| } | ||
| } catch (error) { | ||
| console.log(error); |
Copilot
AI
Dec 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use console.error() instead of console.log() for error logging to properly categorize the log output.
| }); | ||
| return res.status(200).json({ result }); | ||
| } catch (error) { | ||
| console.log(error); |
Copilot
AI
Dec 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use console.error() instead of console.log() for error logging to properly categorize the log output.
| console.log(error); | |
| console.error(error); |
| // const { errors, isValid } = validateCreateEditReview(req.body); | ||
| // if (!isValid) return res.status(400).json(errors); |
Copilot
AI
Dec 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Validation is commented out, which means invalid review data can be submitted without any checks. This could lead to data integrity issues. Either uncomment the validation or remove it if it's intentionally disabled.
| // const { errors, isValid } = validateCreateEditReview(req.body); | |
| // if (!isValid) return res.status(400).json(errors); | |
| const { errors, isValid } = validateCreateEditReview(req.body); | |
| if (!isValid) return res.status(400).json(errors); |
No description provided.