mirror of
https://github.com/unmojang/drasl.git
synced 2025-09-19 12:15:31 -04:00
add login API route to ratelimiter
This commit is contained in:
parent
d742431c92
commit
7f322b247b
5
main.go
5
main.go
@ -88,7 +88,8 @@ func makeRateLimiter(app *App) echo.MiddlewareFunc {
|
||||
"/web/logout",
|
||||
"/web/register",
|
||||
"/web/update-user",
|
||||
"/web/update-player":
|
||||
"/web/update-player",
|
||||
DRASL_API_PREFIX + "/login":
|
||||
return false
|
||||
default:
|
||||
return true
|
||||
@ -97,7 +98,7 @@ func makeRateLimiter(app *App) echo.MiddlewareFunc {
|
||||
Store: middleware.NewRateLimiterMemoryStore(requestsPerSecond),
|
||||
DenyHandler: func(c echo.Context, identifier string, err error) error {
|
||||
path := c.Path()
|
||||
if GetPathType(path) == PathTypeYggdrasil {
|
||||
if GetPathType(path) == PathTypeYggdrasil|PathTypeAPI {
|
||||
return &echo.HTTPError{
|
||||
Code: http.StatusTooManyRequests,
|
||||
Message: "Too many requests. Try again later.",
|
||||
|
Loading…
x
Reference in New Issue
Block a user