diff options
author | 2024-04-15 14:22:21 +0100 | |
---|---|---|
committer | 2024-04-15 14:22:21 +0100 | |
commit | f79d50b9b26590b6d2468aeb41f0846272e08d1a (patch) | |
tree | 196b9bfaf8ad6fce782c2130633cfb5c97cbd31a /internal/api | |
parent | [chore] Turn `accounts-registration-open` false by default (#2839) (diff) | |
download | gotosocial-f79d50b9b26590b6d2468aeb41f0846272e08d1a.tar.xz |
[performance] cached oauth database types (#2838)
* update token + client code to use struct caches
* add code comments
* slight tweak to default mem ratios
* fix envparsing
* add appropriate invalidate hooks
* update the tokenstore sweeping function to rely on caches
* update to use PutClient()
* add ClientID to list of token struct indices
Diffstat (limited to 'internal/api')
-rw-r--r-- | internal/api/auth/token.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/api/auth/token.go b/internal/api/auth/token.go index cab9352fa..d9f0d8154 100644 --- a/internal/api/auth/token.go +++ b/internal/api/auth/token.go @@ -49,7 +49,7 @@ func (m *Module) TokenPOSTHandler(c *gin.Context) { form := &tokenRequestForm{} if err := c.ShouldBind(form); err != nil { - apiutil.OAuthErrorHandler(c, gtserror.NewErrorBadRequest(oauth.InvalidRequest(), err.Error())) + apiutil.OAuthErrorHandler(c, gtserror.NewErrorBadRequest(oauth.ErrInvalidRequest, err.Error())) return } @@ -98,7 +98,7 @@ func (m *Module) TokenPOSTHandler(c *gin.Context) { } if len(help) != 0 { - apiutil.OAuthErrorHandler(c, gtserror.NewErrorBadRequest(oauth.InvalidRequest(), help...)) + apiutil.OAuthErrorHandler(c, gtserror.NewErrorBadRequest(oauth.ErrInvalidRequest, help...)) return } |