passport-discord icon indicating copy to clipboard operation
passport-discord copied to clipboard

Delay fetching guilds

Open fsjuhl opened this issue 4 years ago • 1 comments

When experiencing a lot of requests, you sometimes get rate limited on fetching guilds. This allows you to add a scopeDelay to avoid it. Solves issue #27

fsjuhl avatar Jul 21 '20 19:07 fsjuhl

@fsjuhl I think this might be related to the fact that the first callback is not returned if there is an error: https://github.com/nicholastay/passport-discord/blob/f8c55dcd34bd20bf692604d69db776c63ad1b91b/lib/strategy.js#L100

I have returned the callback in my fork of the library and haven't ever run into the issue you are describing. You can check out there changes here: https://github.com/tonestrike/passport-discord.

My theory is that since this is sometimes erroring, it will cause issues for your user who would then try to login again quickly and get the rate limit. Discord only typically rate limits if you make an identical request too fast.

tonestrike avatar Jan 28 '21 15:01 tonestrike