R81 增加企微回调身份诊断
这个提交包含在:
@@ -363,11 +363,25 @@ async function wecomAuthRoutes(fastify) {
|
||||
const returnTo = sanitizeReturnTo(ctx.returnTo, fastify.config, request);
|
||||
const profile = await exchangeWecomCode(fastify.config, code);
|
||||
if (!profile.externalUserId) {
|
||||
request.log.warn(
|
||||
{
|
||||
requestId: request.id,
|
||||
mode,
|
||||
hasUserId: false,
|
||||
hasOpenId: Boolean(profile.externalOpenUserId),
|
||||
hasDeviceId: Boolean(profile.deviceId),
|
||||
},
|
||||
"wecom callback missing internal user id",
|
||||
);
|
||||
throw new AppError({
|
||||
code: "AUTH_003",
|
||||
message: "企业微信认证失败",
|
||||
statusCode: 401,
|
||||
details: { wecom: "missing_user_id" },
|
||||
details: {
|
||||
wecom: "missing_user_id",
|
||||
hasOpenId: Boolean(profile.externalOpenUserId),
|
||||
mode,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
在新工单中引用
屏蔽一个用户