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

Turn off weak verify for most endpoints #143

Merged
merged 2 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/services/auth/auth-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ authRouter.get("/dev/", (req, res) => {

authRouter.get(
"/corporate",
RoleChecker([Role.Enum.ADMIN], true),
RoleChecker([Role.Enum.ADMIN]),
async (req, res, next) => {
try {
const allCorporate = await Database.CORPORATE.find();
Expand All @@ -168,7 +168,7 @@ authRouter.get(

authRouter.post(
"/corporate",
RoleChecker([Role.Enum.ADMIN], true),
RoleChecker([Role.Enum.ADMIN]),
async (req, res, next) => {
try {
const attendeeData = CorporateValidator.parse(req.body);
Expand All @@ -184,7 +184,7 @@ authRouter.post(

authRouter.delete(
"/corporate",
RoleChecker([Role.Enum.ADMIN], true),
RoleChecker([Role.Enum.ADMIN]),
async (req, res, next) => {
try {
const attendeeData = CorporateDeleteRequest.parse(req.body);
Expand Down
4 changes: 2 additions & 2 deletions src/services/events/events-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ eventsRouter.post(

eventsRouter.put(
"/:EVENTID",
RoleChecker([Role.Enum.STAFF], true),
RoleChecker([Role.Enum.STAFF]),
async (req, res, next) => {
const eventId = req.params.EVENTID;
try {
Expand Down Expand Up @@ -148,7 +148,7 @@ eventsRouter.put(
// Delete event
eventsRouter.delete(
"/:EVENTID",
RoleChecker([Role.Enum.ADMIN], true),
RoleChecker([Role.Enum.ADMIN]),
async (req, res, next) => {
const eventId = req.params.EVENTID;
try {
Expand Down
4 changes: 2 additions & 2 deletions src/services/speakers/speakers-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ speakersRouter.post(
// Update a speaker
speakersRouter.put(
"/:SPEAKERID",
RoleChecker([Role.Enum.STAFF], true),
RoleChecker([Role.Enum.STAFF]),
async (req, res, next) => {
const speakerId = req.params.SPEAKERID;

Expand Down Expand Up @@ -87,7 +87,7 @@ speakersRouter.put(
// Delete a speaker
speakersRouter.delete(
"/:SPEAKERID",
RoleChecker([Role.Enum.STAFF], true),
RoleChecker([Role.Enum.STAFF]),
async (req, res, next) => {
const speakerId = req.params.SPEAKERID;

Expand Down
2 changes: 1 addition & 1 deletion src/services/stats/stats-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ statsRouter.get(
// Get the dietary restriction breakdown/counts (staff only)
statsRouter.get(
"/dietary-restrictions",
RoleChecker([Role.enum.STAFF], true),
RoleChecker([Role.enum.STAFF], false),
async (req, res, next) => {
try {
const results = await Promise.allSettled([
Expand Down