summaryrefslogtreecommitdiffstats
path: root/api/WhatApi/Templates
diff options
context:
space:
mode:
authorivar <i@oiee.no>2025-12-04 00:17:16 +0100
committerivar <i@oiee.no>2025-12-04 00:17:16 +0100
commit724860c272afb7fe5a02645ef1c1b8d208d897f3 (patch)
treedf9b72b9cd9cc716ceb19a4a9085b8f1ba5b6972 /api/WhatApi/Templates
parent401226a14f3e5ef98b959e818d37683afd7056d9 (diff)
downloadwhat-724860c272afb7fe5a02645ef1c1b8d208d897f3.tar.xz
what-724860c272afb7fe5a02645ef1c1b8d208d897f3.zip
POC auth in app
Diffstat (limited to 'api/WhatApi/Templates')
-rw-r--r--api/WhatApi/Templates/TemplateFulfiller.cs6
-rw-r--r--api/WhatApi/Templates/web_login.liquid37
2 files changed, 43 insertions, 0 deletions
diff --git a/api/WhatApi/Templates/TemplateFulfiller.cs b/api/WhatApi/Templates/TemplateFulfiller.cs
index 19d3bde..3433701 100644
--- a/api/WhatApi/Templates/TemplateFulfiller.cs
+++ b/api/WhatApi/Templates/TemplateFulfiller.cs
@@ -8,6 +8,7 @@ public class TemplateFulfiller
private static readonly string TemplateDirectory = Path.Combine(Directory.GetCurrentDirectory(), "Templates");
private static string WebMapTemplate => File.ReadAllText(Path.Combine(TemplateDirectory, "web_map.liquid"));
private static string WebUploadTemplate => File.ReadAllText(Path.Combine(TemplateDirectory, "web_upload.liquid"));
+ private static string WebLoginTemplate => File.ReadAllText(Path.Combine(TemplateDirectory, "web_login.liquid"));
public static string WebMapPage(object? data = null) {
Parser.TryParse(WebMapTemplate, out var template);
@@ -20,4 +21,9 @@ public class TemplateFulfiller
var context = data is null ? new TemplateContext() : new TemplateContext(data);
return template.Render(context);
}
+ public static string WebLoginPage(object? data = null) {
+ Parser.TryParse(WebLoginTemplate, out var template);
+ var context = data is null ? new TemplateContext() : new TemplateContext(data);
+ return template.Render(context);
+ }
} \ No newline at end of file
diff --git a/api/WhatApi/Templates/web_login.liquid b/api/WhatApi/Templates/web_login.liquid
new file mode 100644
index 0000000..e9e545d
--- /dev/null
+++ b/api/WhatApi/Templates/web_login.liquid
@@ -0,0 +1,37 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport"
+ content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
+ <meta http-equiv="X-UA-Compatible"
+ content="ie=edge">
+ <style>
+ form {
+ margin: 12px 10px;
+ display: grid;
+ grid-template-columns: 1fr;
+ grid-template-rows: 1fr 1fr;
+ max-width: 420px;
+ width: 100%;
+ grid-row-gap: 6px;
+ }
+ </style>
+ <title>Login</title>
+</head>
+<body>
+<form action="" method="post" accept-charset="utf-8" autocomplete="off">
+ <label for="username">username
+ <input type="text"
+ name="username"
+ required>
+ </label>
+ <label for="password">password
+ <input type="password"
+ name="password"
+ required>
+ </label>
+ <input type="submit" value="Login" style="width: 50px;">
+</form>
+</body>
+</html> \ No newline at end of file