mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-10-31 14:32:24 -05:00 
			
		
		
		
	[chore] Return more useful errors from auth failure (#494)
* try rsa_sha256 sig algo first * return more informative errors from auth * adapt to reworked auth function
This commit is contained in:
		
					parent
					
						
							
								728c4a5e38
							
						
					
				
			
			
				commit
				
					
						9cf66bf298
					
				
			
		
					 9 changed files with 92 additions and 65 deletions
				
			
		|  | @ -20,7 +20,6 @@ package federation | |||
| 
 | ||||
| import ( | ||||
| 	"context" | ||||
| 	"errors" | ||||
| 	"fmt" | ||||
| 	"net/url" | ||||
| 
 | ||||
|  | @ -37,9 +36,9 @@ func (p *processor) GetOutbox(ctx context.Context, requestedUsername string, pag | |||
| 	} | ||||
| 
 | ||||
| 	// 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) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue