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 удалений

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

@@ -111,13 +111,9 @@ func completeSaml(c *Context, w http.ResponseWriter, r *http.Request) {
}
handleError := func(err *model.AppError) {
if isMobile {
if isMobile && hasRedirectURL {
err.Translate(c.App.T)
if hasRedirectURL {
utils.RenderMobileError(c.App.Config(), w, err, redirectURL)
} else {
w.Write([]byte(err.ToJson()))
}
utils.RenderMobileError(c.App.Config(), w, err, redirectURL)
} else {
c.Err = err
c.Err.StatusCode = http.StatusFound