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,6 +111,7 @@ func RenderWebError(config *model.Config, w http.ResponseWriter, r *http.Request
fmt.Fprintln(w, `<!DOCTYPE html><html><head></head>`)
fmt.Fprintln(w, `<body onload="window.location = '`+template.HTMLEscapeString(template.JSEscapeString(destination))+`'">`)
fmt.Fprintln(w, `<noscript><meta http-equiv="refresh" content="0; url=`+template.HTMLEscapeString(destination)+`"></noscript>`)
fmt.Fprintln(w, `<!-- web error message -->`)
fmt.Fprintln(w, `<a href="`+template.HTMLEscapeString(destination)+`" style="color: #c0c0c0;">...</a>`)
fmt.Fprintln(w, `</body></html>`)
}
@@ -170,6 +171,7 @@ func RenderMobileMessage(w http.ResponseWriter, message string) {
</style>
</head>
<body>
<!-- mobile app message -->
<div class="container-fluid">
<div class="message-container">
`+message+`