feat: 更新JWKS token创建逻辑,支持refresh token选项

This commit is contained in:
2026-03-03 19:10:57 +08:00
parent bb4096ce7e
commit d2913dd32d
3 changed files with 24 additions and 14 deletions

View File

@@ -34,7 +34,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 || '' }, { save: false });
const token = await User.createJwksTokenResponse({ id: userId, username: user?.username || '' }, { hasRefreshToken: false });
const urlObj = new URL(link);
urlObj.searchParams.set('token', token.accessToken);
const resultLink = await fetch(urlObj.toString(), { method: 'GET' }).then(res => res.json())