diff options
| author | Leonardo Bishop <me@leonardobishop.net> | 2025-07-14 01:24:40 +0100 |
|---|---|---|
| committer | Leonardo Bishop <me@leonardobishop.net> | 2025-07-14 01:24:40 +0100 |
| commit | 08a3fb8a2b0281c3c329b33215ec7f8866add606 (patch) | |
| tree | ff8a5413449ea198bc063bf0099fc025ea49c82b /web/command/html/authenticate.go | |
| parent | 684787bcb72aece2aa914597a3bc8788432e66f7 (diff) | |
Add authentication and ability to change host
Diffstat (limited to 'web/command/html/authenticate.go')
| -rw-r--r-- | web/command/html/authenticate.go | 43 |
1 files changed, 43 insertions, 0 deletions
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"), + ), + ), + ), + ) +} |
