mirror of
https://git.sr.ht/~roxwize/mipilin
synced 2025-05-12 00:03:06 +00:00
uhhh yeah
Signed-off-by: roxwize <rae@roxwize.xyz>
This commit is contained in:
parent
5abe0b5fad
commit
afc634b0d2
43 changed files with 573 additions and 3792 deletions
|
@ -2,7 +2,7 @@ import { NodePgDatabase } from "drizzle-orm/node-postgres";
|
|||
import { Express } from "express";
|
||||
import { follows, profiles, updates, users } from "../db/schema.js";
|
||||
import { and, desc, eq } from "drizzle-orm";
|
||||
import { getMoods, render } from "./util.js";
|
||||
import { getMoods, render, UserStatus } from "./util.js";
|
||||
import { PgColumn } from "drizzle-orm/pg-core";
|
||||
import dayjs from "dayjs";
|
||||
|
||||
|
@ -88,13 +88,13 @@ export default async function (app: Express, db: NodePgDatabase) {
|
|||
res.redirect("/login");
|
||||
return;
|
||||
}
|
||||
const { uname, mod } = (
|
||||
const { uname } = (
|
||||
await db
|
||||
.select({ uname: users.name, mod: users.moderator })
|
||||
.select({ uname: users.name })
|
||||
.from(users)
|
||||
.where(eq(users.name, req.params.user))
|
||||
)[0];
|
||||
if ((uname || "") !== req.session["user"] && !mod) {
|
||||
if ((uname || "") !== req.session["user"] && !(req.session["status"] & UserStatus.MODERATOR)) {
|
||||
res.redirect("back");
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue