fix: lark calendar get app access token bug (#4043)
Co-authored-by: chengcheng.frontend <[email protected]>
This commit is contained in:
1 parent
fe12a83898
commit
ad8d0a4e77
2 files changed
+6
-1
No files matched your search
@@ -55,7 +55,8 @@ async function postHandler(req: NextApiRequest, res: NextApiResponse) {
|
|||||||
|
|
||||||
// used for events handler binding in lark open platform, see
|
// used for events handler binding in lark open platform, see
|
||||||
// https://open.larksuite.com/document/ukTMukTMukTM/uUTNz4SN1MjL1UzM?lang=en-US
|
// https://open.larksuite.com/document/ukTMukTMukTM/uUTNz4SN1MjL1UzM?lang=en-US
|
||||||
if (req.body.type === "url_verification") {
|
if (req.body.type === "url_verification" && req.body.token === open_verification_token) {
|
||||||
|
log.debug("update token", req.body);
|
||||||
return res.status(200).json({ challenge: req.body.challenge });
|
return res.status(200).json({ challenge: req.body.challenge });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,10 @@ function makePoolingPromise<T>(
|
|||||||
const appKeysSchema = z.object({
|
const appKeysSchema = z.object({
|
||||||
app_id: z.string().min(1),
|
app_id: z.string().min(1),
|
||||||
app_secret: z.string().min(1),
|
app_secret: z.string().min(1),
|
||||||
|
app_access_token: z.string().optional(),
|
||||||
|
app_ticket: z.string().optional(),
|
||||||
|
expire_date: z.number().optional(),
|
||||||
|
open_verification_token: z.string().min(1),
|
||||||
});
|
});
|
||||||
|
|
||||||
const getValidAppKeys = async (): Promise<ReturnType<typeof getAppKeys>> => {
|
const getValidAppKeys = async (): Promise<ReturnType<typeof getAppKeys>> => {
|
||||||
|
|||||||
Reference in new issue
Block a user