summaryrefslogtreecommitdiff
path: root/internal/api/auth/oob.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2023-02-02 14:08:13 +0100
committerLibravatar GitHub <noreply@github.com>2023-02-02 14:08:13 +0100
commit382512a5a6cc3f13576bbde8d607098d019f4063 (patch)
treedc2ccd1d30cd65b3f3d576a8d2a6910bbecc593a /internal/api/auth/oob.go
parent[chore/performance] use only 1 sqlite db connection regardless of multiplier ... (diff)
downloadgotosocial-382512a5a6cc3f13576bbde8d607098d019f4063.tar.xz
[feature] Implement `/api/v2/instance` endpoint (#1409)
* interim: start adding /api/v2/instance * finish up
Diffstat (limited to 'internal/api/auth/oob.go')
-rw-r--r--internal/api/auth/oob.go10
1 files changed, 4 insertions, 6 deletions
diff --git a/internal/api/auth/oob.go b/internal/api/auth/oob.go
index f8154545b..59eac70cc 100644
--- a/internal/api/auth/oob.go
+++ b/internal/api/auth/oob.go
@@ -28,21 +28,19 @@ import (
"github.com/gin-gonic/gin"
apimodel "github.com/superseriousbusiness/gotosocial/internal/api/model"
apiutil "github.com/superseriousbusiness/gotosocial/internal/api/util"
- "github.com/superseriousbusiness/gotosocial/internal/config"
"github.com/superseriousbusiness/gotosocial/internal/db"
"github.com/superseriousbusiness/gotosocial/internal/gtserror"
"github.com/superseriousbusiness/gotosocial/internal/oauth"
)
func (m *Module) OobHandler(c *gin.Context) {
- host := config.GetHost()
- instance, errWithCode := m.processor.InstanceGet(c.Request.Context(), host)
+ instance, errWithCode := m.processor.InstanceGetV1(c.Request.Context())
if errWithCode != nil {
- apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGet)
+ apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
}
- instanceGet := func(ctx context.Context, domain string) (*apimodel.Instance, gtserror.WithCode) {
+ instanceGet := func(ctx context.Context) (*apimodel.InstanceV1, gtserror.WithCode) {
return instance, nil
}
@@ -69,7 +67,7 @@ func (m *Module) OobHandler(c *gin.Context) {
if len(errs) != 0 {
errs = append(errs, oauth.HelpfulAdvice)
- apiutil.ErrorHandler(c, gtserror.NewErrorBadRequest(errors.New("one or more missing keys on session during OobHandler"), errs...), m.processor.InstanceGet)
+ apiutil.ErrorHandler(c, gtserror.NewErrorBadRequest(errors.New("one or more missing keys on session during OobHandler"), errs...), m.processor.InstanceGetV1)
return
}