app
components
data
functions
api
admin-apps
appeals
auth
game-appeals
game-bans
[user]
_middleware.ts
gme
inactivity
infractions
mod-queue
reports
uploads
_middleware.ts
gcloud.ts
permissions.ts
roblox-open-cloud.ts
public
.gitignore
.node-version
OFL.txt
emotion-server.js
index.css
index.d.ts
package-lock.json
package.json
remix.config.js
server.ts
theme.ts
tsconfig.json
22 lines
513 B
TypeScript
22 lines
513 B
TypeScript
export async function onRequest(context: RequestContext) {
|
|
const { current_user: currentUser } = context.data;
|
|
|
|
if (!currentUser)
|
|
return new Response('{"error":Not logged in"}', {
|
|
headers: {
|
|
"content-type": "application/json",
|
|
},
|
|
status: 401,
|
|
});
|
|
|
|
if (!(currentUser.permissions & (1 << 5)))
|
|
return new Response('{"error":"Forbidden"}', {
|
|
headers: {
|
|
"content-type": "application/json",
|
|
},
|
|
status: 403,
|
|
});
|
|
|
|
return await context.next();
|
|
}
|