From 8995046110147ae2c8c98be4e0a8c0b643ccc29c Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Fri, 7 Jul 2023 07:31:56 +0200 Subject: Less naked returns (#25713) just a step towards #25655 and some related refactoring --- models/auth/oauth2.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'models/auth') diff --git a/models/auth/oauth2.go b/models/auth/oauth2.go index 53a5c28b4a..0f64b56c16 100644 --- a/models/auth/oauth2.go +++ b/models/auth/oauth2.go @@ -306,9 +306,10 @@ func (code *OAuth2AuthorizationCode) TableName() string { } // GenerateRedirectURI generates a redirect URI for a successful authorization request. State will be used if not empty. -func (code *OAuth2AuthorizationCode) GenerateRedirectURI(state string) (redirect *url.URL, err error) { - if redirect, err = url.Parse(code.RedirectURI); err != nil { - return +func (code *OAuth2AuthorizationCode) GenerateRedirectURI(state string) (*url.URL, error) { + redirect, err := url.Parse(code.RedirectURI) + if err != nil { + return nil, err } q := redirect.Query() if state != "" { -- cgit v1.2.3