【发布时间】:2020-07-27 18:04:23
【问题描述】:
在example 中使用了以下代码:
import { BearerStrategy } from 'passport-azure-ad'
const bearerStrategy = new BearerStrategy(config, (token, done) => {
// Send user info using the second argument
done(null, {}, token);
}
);
src/index.ts:26:12 - error TS2349: This expression is not callable.
Type 'ITokenPayload' has no call signatures.
26 return done(null, {}, token)
虽然代码有效,但我想知道如何避免此错误。
【问题讨论】:
-
试试
new BearerStrategy(config, (token: ITokenPayload, done: CallableFunction) => ... -
是的,解决了!如果您将其写为答案,我会将其标记为已解决。谢谢。
标签: typescript passport.js passport-azure-ad