mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +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) {
|
async get(args: any) {
|
||||||
const provider = this.ctx.oauth.providers[args.type];
|
const provider = this.ctx.oauth.providers[args.type];
|
||||||
if (!provider) throw new UserFacingError('Oauth type');
|
if (!provider) throw new UserFacingError('Oauth type');
|
||||||
|
await this.limitRate('oauth_callback', 60, 5);
|
||||||
const r = await provider.callback.call(this, args);
|
const r = await provider.callback.call(this, args);
|
||||||
if (this.session.oauthBind === args.type) {
|
if (this.session.oauthBind === args.type) {
|
||||||
delete this.session.oauthBind;
|
delete this.session.oauthBind;
|
||||||
|
|||||||
Reference in new issue
Block a user