mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
core: oauth: set rate limit for oauth
This commit is contained in:
1 file changed
+1
@@ -464,6 +464,7 @@ class OauthCallbackHandler extends Handler {
|
||||
async get(args: any) {
|
||||
const provider = this.ctx.oauth.providers[args.type];
|
||||
if (!provider) throw new UserFacingError('Oauth type');
|
||||
await this.limitRate('oauth_callback', 60, 5);
|
||||
const r = await provider.callback.call(this, args);
|
||||
if (this.session.oauthBind === args.type) {
|
||||
delete this.session.oauthBind;
|
||||
|
||||
Reference in new issue
Block a user