package templates import ( "github.com/chasefleming/elem-go" "github.com/chasefleming/elem-go/attrs" "github.com/chasefleming/elem-go/styles" ) // checkboxIcon returns the success checkbox SVG icon as raw HTML. func checkboxIcon() elem.Node { return elem.Raw(``) } // OIDCCallback renders the OIDC authentication success callback page. func OIDCCallback(user, verb string) *elem.Element { // Success message box successBox := elem.Div(attrs.Props{ attrs.Style: styles.Props{ styles.Display: "flex", styles.AlignItems: "center", styles.Gap: spaceM, styles.Padding: spaceL, styles.BackgroundColor: colorSuccessLight, styles.Border: "1px solid " + colorSuccess, styles.BorderRadius: "0.5rem", styles.MarginBottom: spaceXL, }.ToInline(), }, checkboxIcon(), elem.Div(nil, elem.Strong(attrs.Props{ attrs.Style: styles.Props{ styles.Display: "block", styles.Color: colorSuccess, styles.FontSize: fontSizeH3, styles.MarginBottom: spaceXS, }.ToInline(), }, elem.Text("Signed in successfully")), elem.P(attrs.Props{ attrs.Style: styles.Props{ styles.Margin: "0", styles.Color: colorTextPrimary, styles.FontSize: fontSizeBase, }.ToInline(), }, elem.Text(verb), elem.Text(" as "), elem.Strong(nil, elem.Text(user)), elem.Text(". You can now close this window.")), ), ) return HtmlStructure( elem.Title(nil, elem.Text("Headscale Authentication Succeeded")), mdTypesetBody( headscaleLogo(), successBox, H2(elem.Text("Getting started")), P(elem.Text("Check out the documentation to learn more about headscale and Tailscale:")), Ul( elem.Li(nil, externalLink("https://github.com/juanfont/headscale/tree/main/docs", "Headscale documentation"), ), elem.Li(nil, externalLink("https://tailscale.com/kb/", "Tailscale knowledge base"), ), ), pageFooter(), ), ) }