diff options
author | 2022-10-08 13:49:56 +0200 | |
---|---|---|
committer | 2022-10-08 13:49:56 +0200 | |
commit | 3bb45b71796cc4e7010a6ba89c27760877084d71 (patch) | |
tree | 1cdd737963482daab1c99636dc8f25205d628f09 /internal/api/client/auth/callback.go | |
parent | [bugfix] Fix new domain block date (#893) (diff) | |
download | gotosocial-3bb45b71796cc4e7010a6ba89c27760877084d71.tar.xz |
[feature] `oob` oauth token support (#889)
* move helpful advice into oauth server
* rewrite HandleAuthorizeRequest to allow oob
Diffstat (limited to 'internal/api/client/auth/callback.go')
-rw-r--r-- | internal/api/client/auth/callback.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/internal/api/client/auth/callback.go b/internal/api/client/auth/callback.go index daee2ae31..cf2c906a5 100644 --- a/internal/api/client/auth/callback.go +++ b/internal/api/client/auth/callback.go @@ -34,6 +34,7 @@ import ( "github.com/superseriousbusiness/gotosocial/internal/db" "github.com/superseriousbusiness/gotosocial/internal/gtserror" "github.com/superseriousbusiness/gotosocial/internal/gtsmodel" + "github.com/superseriousbusiness/gotosocial/internal/oauth" "github.com/superseriousbusiness/gotosocial/internal/oidc" "github.com/superseriousbusiness/gotosocial/internal/validate" ) @@ -91,7 +92,7 @@ func (m *Module) CallbackGETHandler(c *gin.Context) { if !ok || clientID == "" { m.clearSession(s) err := fmt.Errorf("key %s was not found in session", sessionClientID) - api.ErrorHandler(c, gtserror.NewErrorBadRequest(err, helpfulAdvice), m.processor.InstanceGet) + api.ErrorHandler(c, gtserror.NewErrorBadRequest(err, oauth.HelpfulAdvice), m.processor.InstanceGet) return } @@ -101,9 +102,9 @@ func (m *Module) CallbackGETHandler(c *gin.Context) { safe := fmt.Sprintf("application for %s %s could not be retrieved", sessionClientID, clientID) var errWithCode gtserror.WithCode if err == db.ErrNoEntries { - errWithCode = gtserror.NewErrorBadRequest(err, safe, helpfulAdvice) + errWithCode = gtserror.NewErrorBadRequest(err, safe, oauth.HelpfulAdvice) } else { - errWithCode = gtserror.NewErrorInternalError(err, safe, helpfulAdvice) + errWithCode = gtserror.NewErrorInternalError(err, safe, oauth.HelpfulAdvice) } api.ErrorHandler(c, errWithCode, m.processor.InstanceGet) return |