Skip to content

Commit

Permalink
removed intern role for accessing endoints
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebbben committed Nov 15, 2024
1 parent dc4e9fd commit 23799d5
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions app/api/v2/memberships/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export async function GET(req) {

const session = await getServerSession(authOptions)
const authCheck = new Auth(session)
.requireRoles(["intern"])
.requireRoles([])

if (authCheck.failed) return authCheck.response

Expand Down Expand Up @@ -46,7 +46,7 @@ export async function POST(req) {
const session = await getServerSession(authOptions)
const params = await req.json()
const authCheck = new Auth(session, params)
.requireRoles(["intern"])
.requireRoles([])
.requireParams(["name", "email", "comments", "seller_id", "semester_id"])

if (authCheck.failed) return authCheck.response
Expand Down
2 changes: 1 addition & 1 deletion app/api/v2/recruitGraph/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { authOptions } from "@/app/api/v2/auth/[...nextauth]/route";
export async function GET(req) {
const session = await getServerSession(authOptions)
const authCheck = new Auth(session)
.requireRoles(["intern"])
.requireRoles([])

if (authCheck.failed) return authCheck.verify(authCheck.response)

Expand Down
4 changes: 2 additions & 2 deletions app/api/v2/shifts/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { authOptions } from "@/app/api/v2/auth/[...nextauth]/route";
export async function GET(req) {
const session = await getServerSession(authOptions)
const authCheck = new Auth(session)
.requireRoles(["intern"])
.requireRoles([])

if (authCheck.failed) return authCheck.verify(authCheck.response)

Expand Down Expand Up @@ -48,7 +48,7 @@ export async function POST(req) {
const session = await getServerSession(authOptions)
const params = await req.json();
const authCheck = new Auth(session, params)
.requireRoles(["intern"])
.requireRoles([])
.requireParams(["selectedDay", "shiftManagerId", "shiftWorker1Id", "shiftWorker2Id"])

if (authCheck.failed) return authCheck.verify(authCheck.response)
Expand Down
2 changes: 1 addition & 1 deletion app/api/v2/users/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export async function GET(req) {

const session = await getServerSession(authOptions)
const authCheck = new Auth(session)
.requireRoles(["intern"])
.requireRoles([])

if (authCheck.failed) return authCheck.verify(authCheck.response)

Expand Down
4 changes: 2 additions & 2 deletions app/api/v2/voucherLogs/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export async function GET(req) {

const session = await getServerSession(authOptions)
const authCheck = new Auth(session)
.requireRoles(["intern"])
.requireRoles([])

if (authCheck.failed) return authCheck.verify(authCheck.response)

Expand Down Expand Up @@ -47,7 +47,7 @@ export async function POST(req) {
const session = await getServerSession(authOptions)
const params = await req.json()
const authCheck = new Auth(session, params)
.requireRoles(["intern"])
.requireRoles([])
.requireParams(["loggedFor", "amount", "description", "semesterId"])

if (authCheck.failed) return authCheck.verify(authCheck.response)
Expand Down
4 changes: 2 additions & 2 deletions app/api/v2/workGroups/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export async function GET(req) {

const session = await getServerSession(authOptions)
const authCheck = new Auth(session)
.requireRoles(["intern"])
.requireRoles([])

if (authCheck.failed) return authCheck.verify(authCheck.response)

Expand All @@ -36,7 +36,7 @@ export async function POST(req) {
const session = await getServerSession(authOptions)
const params = await req.json()
const authCheck = new Auth(session, params)
.requireRoles(["intern"])
.requireRoles([])
.requireParams(["userId", "workGroupId"])

if (authCheck.failed) return authCheck.verify(authCheck.response)
Expand Down
4 changes: 2 additions & 2 deletions app/api/v2/workLogs/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export async function GET(req) {

const session = await getServerSession(authOptions)
const authCheck = new Auth(session)
.requireRoles(["intern"])
.requireRoles([])

if (authCheck.failed) return authCheck.verify(authCheck.response)

Expand Down Expand Up @@ -46,7 +46,7 @@ export async function POST(req) {
const session = await getServerSession(authOptions)
const params = await req.json()
const authCheck = new Auth(session, params)
.requireRoles(["intern"])
.requireRoles([])
.requireParams(["loggedBy", "loggedFor", "workedAt", "duration", "description", "semesterId"])

if (authCheck.failed) return authCheck.verify(authCheck.response)
Expand Down

0 comments on commit 23799d5

Please sign in to comment.