templates: generalise auth templates for web and OIDC
Extract shared HTML/CSS design into a common template and create generalised auth success and web auth templates that work for both node registration and SSH check authentication flows. Updates #1850
This commit is contained in:
parent
cb3b6949ea
commit
4a7e1475c0
9 changed files with 324 additions and 139 deletions
21
hscontrol/templates/auth_web.go
Normal file
21
hscontrol/templates/auth_web.go
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
package templates
|
||||
|
||||
import (
|
||||
"github.com/chasefleming/elem-go"
|
||||
)
|
||||
|
||||
// AuthWeb renders a page that instructs an administrator to run a CLI command
|
||||
// to complete an authentication or registration flow.
|
||||
// It is used by both the registration and auth-approve web handlers.
|
||||
func AuthWeb(title, description, command string) *elem.Element {
|
||||
return HtmlStructure(
|
||||
elem.Title(nil, elem.Text(title+" - Headscale")),
|
||||
mdTypesetBody(
|
||||
headscaleLogo(),
|
||||
H1(elem.Text(title)),
|
||||
P(elem.Text(description)),
|
||||
Pre(PreCode(command)),
|
||||
pageFooter(),
|
||||
),
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue