Adjust the template for the OIDC callback login page

This commit is contained in:
Viacheslav Sychov 2023-06-05 22:21:31 +02:00 committed by Kristoffer Dalby
parent 0562260fe0
commit 36c9b5ce74
3 changed files with 304 additions and 8 deletions

View file

@ -4,6 +4,7 @@ import (
"bytes"
"context"
"crypto/rand"
_ "embed"
"encoding/hex"
"errors"
"fmt"
@ -182,15 +183,11 @@ type oidcCallbackTemplateConfig struct {
Verb string
}
//go:embed assets/oidc_callback_template.html
var oidcCallbackTemplateContent string
var oidcCallbackTemplate = template.Must(
template.New("oidccallback").Parse(`<html>
<body>
<h1>headscale</h1>
<p>
{{.Verb}} as {{.User}}, you can now close this window.
</p>
</body>
</html>`),
template.New("oidccallback").Parse(oidcCallbackTemplateContent),
)
// OIDCCallback handles the callback from the OIDC endpoint