From 08a3fb8a2b0281c3c329b33215ec7f8866add606 Mon Sep 17 00:00:00 2001 From: Leonardo Bishop Date: Mon, 14 Jul 2025 01:24:40 +0100 Subject: Add authentication and ability to change host --- web/command/html/authenticate.go | 43 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 web/command/html/authenticate.go (limited to 'web/command/html/authenticate.go') diff --git a/web/command/html/authenticate.go b/web/command/html/authenticate.go new file mode 100644 index 0000000..27a2321 --- /dev/null +++ b/web/command/html/authenticate.go @@ -0,0 +1,43 @@ +package html + +import ( + . "maragu.dev/gomponents" + . "maragu.dev/gomponents/html" +) + +func AuthenticatePage(err string) Node { + return page("Authenticate", + H1(Text("Welcome to scrapbook")), + + If(err != "", alertError(err)), + + Form( + Action("/authenticate"), + Method("post"), + + FieldSet( + Legend(Text("Authentication")), + Label( + For("token"), + Text("Secret key"), + ), + Input( + ID("token"), + Name("token"), + ), + Span( + Class("form-help"), + Text("Enter the secret key to continue."), + ), + ), + + Div( + Class("control-group group-right"), + Input( + Type("submit"), + Value("Submit"), + ), + ), + ), + ) +} -- cgit v1.2.3-70-g09d2