-
Notifications
You must be signed in to change notification settings - Fork 8
Feat/auto emails #949
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: dev
Are you sure you want to change the base?
Feat/auto emails #949
Conversation
d84cee2 to
54a66c4
Compare
| */ | ||
| automatedEmailRouter.route("/automated/status/:status/count").get( | ||
| Middleware.Auth.ensureAuthenticated(), | ||
| // Middleware.Auth.ensureAuthorized(), |
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.
In the future we can include the handling for the :status parameter for ensureAuthorized in auth.service.js. i'm assuming since it's commented out, currently any hacker can send batch emails using the API bc there's no check to see if api/email/automated/... route is included in the executing user's role.
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.
can we test this? log in as a hacker and try to execute the route in the console. we definitely need to have validation there
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.
we can add permissions for this route to the staff role in the database, and then it should be fine. @janekhuong did you try that? do you need help figuring that out?
joshuazhou744
left a comment
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.
Looks good, I also tested it once locally. Only thing is there's no user validation for who can use this route (api/email/...)
Tickets:
List of changes:
Type of change
How has this been tested?
Create test hackers with valid email addresses. In staff dashboard, change their statuses to accepted/declined. Click "Send Emails" button, choose to send acceptance or declined emails, and then confirm.
Questions for code reviewers?
Checklist: