Skip to content

Commit 36892f9

Browse files
committed
core: oauth: set rate limit for oauth
1 parent ff8345c commit 36892f9

File tree

1 file changed

+1
-0
lines changed
  • packages/hydrooj/src/handler

1 file changed

+1
-0
lines changed

packages/hydrooj/src/handler/user.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,7 @@ class OauthCallbackHandler extends Handler {
464464
async get(args: any) {
465465
const provider = this.ctx.oauth.providers[args.type];
466466
if (!provider) throw new UserFacingError('Oauth type');
467+
await this.limitRate('oauth_callback', 60, 5);
467468
const r = await provider.callback.call(this, args);
468469
if (this.session.oauthBind === args.type) {
469470
delete this.session.oauthBind;

0 commit comments

Comments
 (0)