MM-10573 Add error page if user doesn't authorize Mattermost for OAuth (#9402)

Этот коммит содержится в:
Harrison Healey
2018-09-14 06:32:25 -04:00
коммит произвёл George Goldberg
родитель f2ddef9117
Коммит 8afc529753
2 изменённых файлов: 35 добавлений и 0 удалений

Просмотреть файл

@@ -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{