Handle cases where users are not signed in
This commit is contained in:
parent
074dd1fce5
commit
28ea352596
@ -11,7 +11,7 @@ export async function onRequestPost(context: RequestContext) {
|
|||||||
|
|
||||||
const reportUserId = await context.env.DATA.get(`reportprocessing_${id}`);
|
const reportUserId = await context.env.DATA.get(`reportprocessing_${id}`);
|
||||||
|
|
||||||
if (!reportUserId || context.data.current_user.id !== reportUserId)
|
if (!reportUserId || context.data.current_user?.id !== reportUserId)
|
||||||
return new Response('{"error":"No processing report with that ID found"}', {
|
return new Response('{"error":"No processing report with that ID found"}', {
|
||||||
headers: {
|
headers: {
|
||||||
"content-type": "application/json",
|
"content-type": "application/json",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user