summaryrefslogtreecommitdiff
path: root/internal/processing/federation/getstatus.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2022-04-26 18:10:11 +0200
committerLibravatar GitHub <noreply@github.com>2022-04-26 18:10:11 +0200
commit9cf66bf29871dad6523f421ae72125d584ac4c9a (patch)
tree328b62cb9fb8374dee576a3bb0f2ec213c0e93a0 /internal/processing/federation/getstatus.go
parent[bugfix] Trim log entries to 1700 chars before they enter syslog (#493) (diff)
downloadgotosocial-9cf66bf29871dad6523f421ae72125d584ac4c9a.tar.xz
[chore] Return more useful errors from auth failure (#494)v0.3.1
* try rsa_sha256 sig algo first * return more informative errors from auth * adapt to reworked auth function
Diffstat (limited to 'internal/processing/federation/getstatus.go')
-rw-r--r--internal/processing/federation/getstatus.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/internal/processing/federation/getstatus.go b/internal/processing/federation/getstatus.go
index 3a32ffa59..820f1a19b 100644
--- a/internal/processing/federation/getstatus.go
+++ b/internal/processing/federation/getstatus.go
@@ -20,7 +20,6 @@ package federation
import (
"context"
- "errors"
"fmt"
"net/url"
@@ -38,9 +37,9 @@ func (p *processor) GetStatus(ctx context.Context, requestedUsername string, req
}
// authenticate the request
- requestingAccountURI, authenticated, err := p.federator.AuthenticateFederatedRequest(ctx, requestedUsername)
- if err != nil || !authenticated {
- return nil, gtserror.NewErrorNotAuthorized(errors.New("not authorized"), "not authorized")
+ requestingAccountURI, errWithCode := p.federator.AuthenticateFederatedRequest(ctx, requestedUsername)
+ if errWithCode != nil {
+ return nil, errWithCode
}
requestingAccount, err := p.federator.GetRemoteAccount(ctx, requestedUsername, requestingAccountURI, false, false)