diff options
Diffstat (limited to 'api4/oauth.go')
-rw-r--r-- | api4/oauth.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/api4/oauth.go b/api4/oauth.go index 961b0fecd..990f292e9 100644 --- a/api4/oauth.go +++ b/api4/oauth.go @@ -452,6 +452,15 @@ func completeOAuth(c *Context, w http.ResponseWriter, r *http.Request) { service := c.Params.Service + oauthError := r.URL.Query().Get("error") + if oauthError == "access_denied" { + utils.RenderWebError(c.App.Config(), w, r, http.StatusTemporaryRedirect, url.Values{ + "type": []string{"oauth_access_denied"}, + "service": []string{strings.Title(service)}, + }, c.App.AsymmetricSigningKey()) + return + } + code := r.URL.Query().Get("code") if len(code) == 0 { utils.RenderWebError(c.App.Config(), w, r, http.StatusTemporaryRedirect, url.Values{ |