damp-battery-65635
04/08/2022, 10:48 PMgo
// == define error HTML here ==
const oauthNotConfigured = `<!DOCTYPE html><html>
<body>
<h3>Your Netmaker server does not have OAuth configured.</h3>
<p>Please visit the docs <a href="https://docs.netmaker.org/oauth.html" target="_blank" rel="noopener">here</a> to learn how to.</p>
</body>
</html>
`
// HandleAuthCallback - handles oauth callback
func HandleAuthCallback(w http.ResponseWriter, r *http.Request) {
if auth_provider == nil {
w.Header().Set("Content-Type", "text/html; charset=utf-8")
fmt.Fprintln(w, oauthNotConfigured)
return
}
The fix can be:
go
// == define error HTML here ==
const oauthNotConfigured = `<!DOCTYPE html><html>
<body>
<h3>Your Netmaker server does not have OAuth configured.</h3>
<p>Please visit the docs <a href="https://docs.netmaker.org/oauth.html" target="_blank" rel="noopener">here</a> to learn how to.</p>
</body>
</html>`
Let me know if you guys want to fix this 🙂
I think totally two places has this issue, if fix it then no complain in any CI/CD with go test.