mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-13 21:01:21 +08:00
tests fix
This commit is contained in:
parent
7a54be90b0
commit
ca461d4a26
@ -39,13 +39,18 @@ export const POST = createSmartRouteHandler({
|
||||
throw new StatusError(503, "SpacetimeDB unavailable");
|
||||
}
|
||||
|
||||
const authUser = fullReq.auth?.user;
|
||||
if (!authUser) {
|
||||
throw new StatusError(StatusError.Unauthorized, "Authentication required");
|
||||
}
|
||||
|
||||
const token = getEnvVariable("STACK_MCP_LOG_TOKEN");
|
||||
await conn.reducers.addManualQa({
|
||||
token,
|
||||
question: body.question,
|
||||
answer: body.answer,
|
||||
publish: body.publish,
|
||||
reviewedBy: fullReq.auth.user.display_name ?? fullReq.auth.user.primary_email ?? fullReq.auth.user.id,
|
||||
reviewedBy: authUser.display_name ?? authUser.primary_email ?? authUser.id,
|
||||
});
|
||||
|
||||
return {
|
||||
|
||||
@ -37,11 +37,16 @@ export const POST = createSmartRouteHandler({
|
||||
throw new StatusError(503, "SpacetimeDB unavailable");
|
||||
}
|
||||
|
||||
const authUser = fullReq.auth?.user;
|
||||
if (!authUser) {
|
||||
throw new StatusError(StatusError.Unauthorized, "Authentication required");
|
||||
}
|
||||
|
||||
const token = getEnvVariable("STACK_MCP_LOG_TOKEN");
|
||||
await conn.reducers.markHumanReviewed({
|
||||
token,
|
||||
correlationId: body.correlationId,
|
||||
reviewedBy: fullReq.auth.user.display_name ?? fullReq.auth.user.primary_email ?? fullReq.auth.user.id,
|
||||
reviewedBy: authUser.display_name ?? authUser.primary_email ?? authUser.id,
|
||||
});
|
||||
|
||||
return {
|
||||
|
||||
@ -40,6 +40,11 @@ export const POST = createSmartRouteHandler({
|
||||
throw new StatusError(503, "SpacetimeDB unavailable");
|
||||
}
|
||||
|
||||
const authUser = fullReq.auth?.user;
|
||||
if (!authUser) {
|
||||
throw new StatusError(StatusError.Unauthorized, "Authentication required");
|
||||
}
|
||||
|
||||
const token = getEnvVariable("STACK_MCP_LOG_TOKEN");
|
||||
await conn.reducers.updateHumanCorrection({
|
||||
token,
|
||||
@ -47,7 +52,7 @@ export const POST = createSmartRouteHandler({
|
||||
correctedQuestion: body.correctedQuestion,
|
||||
correctedAnswer: body.correctedAnswer,
|
||||
publish: body.publish,
|
||||
reviewedBy: fullReq.auth.user.display_name ?? fullReq.auth.user.primary_email ?? fullReq.auth.user.id,
|
||||
reviewedBy: authUser.display_name ?? authUser.primary_email ?? authUser.id,
|
||||
});
|
||||
|
||||
return {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user