Skip to content

Commit

Permalink
fix(backend): 招待コード発行可能残り数算出に使用すべきロールポリシーの値が違うのを修正 (misskey-dev#14834)
Browse files Browse the repository at this point in the history
* fix: should use invite limit cycle to calculate invite/limit

* Update Changelog

* Update changelog

---------

Co-authored-by: Lhc_fl <[email protected]>
  • Loading branch information
kakkokari-gtyih and Lhcfl authored Oct 25, 2024
1 parent 07b2c3e commit eeea4ec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
### Server
- Fix: Nested proxy requestsを検出した際にブロックするように
[ghsa-gq5q-c77c-v236](https://github.com/misskey-dev/misskey/security/advisories/ghsa-gq5q-c77c-v236)
- Fix: 招待コードの発行可能な残り数算出に使用すべきロールポリシーの値が違う問題を修正
(Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/706)

## 2024.10.1

Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/server/api/endpoints/invite/limit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
const policies = await this.roleService.getUserPolicies(me.id);

const count = policies.inviteLimit ? await this.registrationTicketsRepository.countBy({
id: MoreThan(this.idService.gen(Date.now() - (policies.inviteExpirationTime * 60 * 1000))),
id: MoreThan(this.idService.gen(Date.now() - (policies.inviteLimitCycle * 60 * 1000))),
createdById: me.id,
}) : null;

Expand Down

0 comments on commit eeea4ec

Please sign in to comment.