Merge branch 'main' into next

This commit is contained in:
nocobase[bot]
2026-07-23 04:13:08 +00:00
@@ -84,6 +84,14 @@ export class TokenController implements TokenControlService {
});
}
private async cleanupSessionExpiredTokens(userId: number) {
try {
await this.removeSessionExpiredTokens(userId);
} catch (err) {
this.logger.error(err, { module: 'auth', submodule: 'token-controller', method: 'removeSessionExpiredTokens' });
}
}
async add({ userId, authenticator }: { userId: number; authenticator?: string }) {
const jti = randomUUID();
const currTS = Date.now();
@@ -97,15 +105,11 @@ export class TokenController implements TokenControlService {
};
await this.setTokenInfo(jti, data);
try {
if (process.env.DB_DIALECT === 'sqlite') {
// SQLITE does not support concurrent operations
await this.removeSessionExpiredTokens(userId);
} else {
this.removeSessionExpiredTokens(userId);
}
} catch (err) {
this.logger.error(err, { module: 'auth', submodule: 'token-controller', method: 'removeSessionExpiredTokens' });
if (process.env.DB_DIALECT === 'sqlite') {
// SQLITE does not support concurrent operations
await this.cleanupSessionExpiredTokens(userId);
} else {
this.cleanupSessionExpiredTokens(userId);
}
return data;