feat: 更新 N5Proxy 以支持生成带有刷新令牌的 JWKS 令牌

This commit is contained in:
xiongxiao
2026-03-18 22:31:31 +08:00
committed by cnb
parent 08884b7e4b
commit 6467e6dea8
2 changed files with 15 additions and 13 deletions

View File

@@ -48,7 +48,7 @@ export const N5Proxy = async (req: IncomingMessage, res: ServerResponse, opts?:
}
try {
const user = await User.findByPk(userId);
const token = await User.createJwksTokenResponse({ id: userId, username: user?.username || '' }, { hasRefreshToken: false });
const token = await User.createJwksTokenResponse({ id: userId, username: user?.username || '' }, { hasRefreshToken: true });
const urlObj = new URL(link);
urlObj.searchParams.set('token', token.accessToken);
const resultLink = await fetch(urlObj.toString(), { method: 'GET' }).then(res => res.json())