#2465·docmost

[BUG] 使用"无过期"创建的 API 密钥产生一个在 JWT TOKEN EXPIRES IN 中过期的符号( 在我们的情况下, 30d 默认)

作者: DaeSoo创建于 2026年9月1日更新于 2026年9月1日

Server — apps/server/src/core/auth/services/token.service.ts:117

typescript
return this.jwtService.sign(payload, expiresIn ? { expiresIn } : {});

With expiresIn undefined, the ternary passes {}, so the token inherits the module-wide default rather than being signed without an exp.

apps/server/src/core/auth/token.module.ts:14

typescript
JwtModule.registerAsync({
  ...
  expiresIn: environmentService.getJwtTokenExpiresIn() as StringValue,

getJwtTokenExpiresIn() defaults to '90d' (environment.service.ts:63), so upstream users would see a 90-day cap instead of 30 — the same bug, just a longer fuse.

内容来源: docmost/docmost