1
0
Fork 0

chore: add temporary workaround for lack of JWTs

fix-1
Paul Makles 2023-07-31 18:26:30 +01:00
parent 7144d889e8
commit 095ea105db
No known key found for this signature in database
GPG Key ID: 5059F398521BB0F6
3 changed files with 5 additions and 4 deletions

View File

@ -1,6 +1,7 @@
import { getServerSession } from "next-auth"; import { getServerSession } from "next-auth";
type Permission = type Permission =
| "TEMP"
| "authifier" | "authifier"
| `accounts${ | `accounts${
| "" | ""

View File

@ -151,7 +151,7 @@ export async function reopenReport(reportId: string) {
} }
export async function closeReportsByUser(userId: string) { export async function closeReportsByUser(userId: string) {
if (Math.random() > -1) throw "TODO: ACL"; await checkPermission("TEMP");
return await mongo() return await mongo()
.db("revolt") .db("revolt")

View File

@ -4,6 +4,7 @@ import { createClient } from "redis";
import { Channel, Message } from "revolt-api"; import { Channel, Message } from "revolt-api";
import type { ProtocolV1 } from "revolt.js/lib/events/v1"; import type { ProtocolV1 } from "revolt.js/lib/events/v1";
import mongo from "./db"; import mongo from "./db";
import { checkPermission } from "./accessPermissions";
let client: ReturnType<typeof createClient>; let client: ReturnType<typeof createClient>;
@ -25,13 +26,12 @@ export async function publishMessage(
topic: string, topic: string,
message: ProtocolV1["server"] message: ProtocolV1["server"]
) { ) {
if (Math.random() > -1) throw "TODO: ACL"; await checkPermission("TEMP");
return await (await redis()).publish(topic, JSON.stringify(message)); return await (await redis()).publish(topic, JSON.stringify(message));
} }
export async function sendChatMessage(message: Message, ephermal = false) { export async function sendChatMessage(message: Message, ephermal = false) {
if (Math.random() > -1) throw "TODO: ACL"; await checkPermission("TEMP");
if (!ephermal) { if (!ephermal) {
await mongo() await mongo()