Skip to content

Commit 7cd365c

Browse files
authored
stomme ding fixen
aaaaaaa
1 parent 3df796e commit 7cd365c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils/auth/ban.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export async function banUserForum(userId: string, banReason: string, banEnd?: s
111111
}
112112
export async function unbanUserPlatform(userId: string) {
113113
const operator = await getUserFromSession()
114-
if (operator.role !== "admin") {
114+
if (operator?.role !== "admin") {
115115
return { success: false, error: 'Unauthorized' }
116116
}
117117
try {
@@ -147,7 +147,7 @@ export async function unbanUserPlatform(userId: string) {
147147
}
148148
export async function unbanUserForum(userId: string) {
149149
const operator = await getUserFromSession()
150-
if (operator.role !== "admin") {
150+
if (operator?.role !== "admin") {
151151
return { success: false, error: 'Unauthorized' }
152152
}
153153
try {

0 commit comments

Comments
 (0)