User friendly error messages during OAUTH and SAML flows (#16795)

* Renders error messages in webapp

* Added unit test

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Anurag Shivarathri
2021-02-21 12:28:04 +05:30
коммит произвёл GitHub
родитель 9aaf29ffb4
Коммит 01e83f64da
4 изменённых файлов: 46 добавлений и 12 удалений

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

@@ -286,12 +286,8 @@ func completeOAuth(c *Context, w http.ResponseWriter, r *http.Request) {
}
renderError := func(err *model.AppError) {
if isMobile {
if hasRedirectURL {
utils.RenderMobileError(c.App.Config(), w, err, redirectURL)
} else {
w.Write([]byte(err.ToJson()))
}
if isMobile && hasRedirectURL {
utils.RenderMobileError(c.App.Config(), w, err, redirectURL)
} else {
utils.RenderWebAppError(c.App.Config(), w, r, err, c.App.AsymmetricSigningKey())
}