diff options
Diffstat (limited to 'api4/oauth.go')
-rw-r--r-- | api4/oauth.go | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/api4/oauth.go b/api4/oauth.go index d747e3422..961b0fecd 100644 --- a/api4/oauth.go +++ b/api4/oauth.go @@ -520,9 +520,9 @@ func completeOAuth(c *Context, w http.ResponseWriter, r *http.Request) { if action == model.OAUTH_ACTION_MOBILE { ReturnStatusOK(w) return - } else { - http.Redirect(w, r, redirectUrl, http.StatusTemporaryRedirect) } + + http.Redirect(w, r, redirectUrl, http.StatusTemporaryRedirect) } func loginWithOAuth(c *Context, w http.ResponseWriter, r *http.Request) { @@ -540,12 +540,13 @@ func loginWithOAuth(c *Context, w http.ResponseWriter, r *http.Request) { return } - if authUrl, err := c.App.GetOAuthLoginEndpoint(w, r, c.Params.Service, teamId, model.OAUTH_ACTION_LOGIN, redirectTo, loginHint); err != nil { + authUrl, err := c.App.GetOAuthLoginEndpoint(w, r, c.Params.Service, teamId, model.OAUTH_ACTION_LOGIN, redirectTo, loginHint) + if err != nil { c.Err = err return - } else { - http.Redirect(w, r, authUrl, http.StatusFound) } + + http.Redirect(w, r, authUrl, http.StatusFound) } func mobileLoginWithOAuth(c *Context, w http.ResponseWriter, r *http.Request) { @@ -560,12 +561,13 @@ func mobileLoginWithOAuth(c *Context, w http.ResponseWriter, r *http.Request) { return } - if authUrl, err := c.App.GetOAuthLoginEndpoint(w, r, c.Params.Service, teamId, model.OAUTH_ACTION_MOBILE, "", ""); err != nil { + authUrl, err := c.App.GetOAuthLoginEndpoint(w, r, c.Params.Service, teamId, model.OAUTH_ACTION_MOBILE, "", "") + if err != nil { c.Err = err return - } else { - http.Redirect(w, r, authUrl, http.StatusFound) } + + http.Redirect(w, r, authUrl, http.StatusFound) } func signupWithOAuth(c *Context, w http.ResponseWriter, r *http.Request) { @@ -587,10 +589,11 @@ func signupWithOAuth(c *Context, w http.ResponseWriter, r *http.Request) { return } - if authUrl, err := c.App.GetOAuthSignupEndpoint(w, r, c.Params.Service, teamId); err != nil { + authUrl, err := c.App.GetOAuthSignupEndpoint(w, r, c.Params.Service, teamId) + if err != nil { c.Err = err return - } else { - http.Redirect(w, r, authUrl, http.StatusFound) } + + http.Redirect(w, r, authUrl, http.StatusFound) } |