summaryrefslogtreecommitdiffstats
path: root/web/views
diff options
context:
space:
mode:
authorLeonardo Bishop <me@leonardobishop.net>2026-01-16 17:19:27 +0000
committerLeonardo Bishop <me@leonardobishop.net>2026-01-16 17:19:27 +0000
commite6cbb8415490524034561102b6c9f03e92e4dae7 (patch)
tree2012f04c11adf636bdd06ae37f5ef3efd7a645a0 /web/views
parent8fc52adfdc705a1b05d3a0aef4d6e63f8ec0308d (diff)
Add OIDC auth
Diffstat (limited to 'web/views')
-rw-r--r--web/views/auth.html21
-rw-r--r--web/views/f_auth_error.html3
-rw-r--r--web/views/index.html2
-rw-r--r--web/views/problem.html36
4 files changed, 57 insertions, 5 deletions
diff --git a/web/views/auth.html b/web/views/auth.html
index 995815a..17ca83d 100644
--- a/web/views/auth.html
+++ b/web/views/auth.html
@@ -18,6 +18,25 @@
<div class="col-12 col-md-6 col-lg-4">
<div class="card mx-auto">
<div class="card-body">
+ <h4 class="card-title mb-3">Welcome</h4>
+
+ <p>Please authenticate to spawn challenge instances.</p>
+
+ {{if .Error}}
+ <div class="alert alert-danger" role="alert">
+ {{.Error}}
+ </div>
+ {{end}}
+
+ <form method="POST">
+ <button type="submit" class="btn btn-primary w-100">
+ Login with {{ .OidcIdPName }}
+ </button>
+ </form>
+ </div>
+ </div>
+<!-- <div class="card mx-auto">
+ <div class="card-body">
<h4 class="card-title mb-3">Enter a team ID</h4>
<div id="auth-response"></div>
@@ -33,7 +52,7 @@
</div>
</form>
</div>
- </div>
+ </div> -->
<div class="card mt-4 mx-auto">
<div class="card-body">
diff --git a/web/views/f_auth_error.html b/web/views/f_auth_error.html
deleted file mode 100644
index 4ebdac3..0000000
--- a/web/views/f_auth_error.html
+++ /dev/null
@@ -1,3 +0,0 @@
-<div class="alert alert-danger" role="alert">
- {{.Message}}
-</div>
diff --git a/web/views/index.html b/web/views/index.html
index 97edc88..81a144d 100644
--- a/web/views/index.html
+++ b/web/views/index.html
@@ -86,7 +86,7 @@
</div>
<div class="mt-2 px-3">
<small class="text-muted">
- Logged in as <b>{{.Team}}</b>.
+ Logged in as <b>{{ .Name }}</b> ({{ .Team }}).
<a href="/logout">Not you</a>?
</small>
</div>
diff --git a/web/views/problem.html b/web/views/problem.html
new file mode 100644
index 0000000..202f651
--- /dev/null
+++ b/web/views/problem.html
@@ -0,0 +1,36 @@
+
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <title>Challenge Instancer</title>
+
+ <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
+ <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.2/dist/umd/popper.min.js" integrity="sha384-IQsoLXl5PILFhosVNubq5LC7Qb9DXgDA9i+tQ8Zj3iwWAwPtgFTxbJ8NT4GN1R8p" crossorigin="anonymous"></script>
+ <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.min.js" integrity="sha384-cVKIPhGWiC2Al4u+LWgxfKTRIcfu0JTxR+EQDz/bgldoEyl4H0zUF0QKbrJ0EcQF" crossorigin="anonymous"></script>
+</head>
+<body class="bg-light">
+
+<div class="container py-5">
+ <div class="row justify-content-center">
+ <div class="col-12 col-md-6 col-lg-4">
+ <div class="card mx-auto">
+ <div class="card-body">
+ <p class="card-text">
+ {{.Error}}
+ </p>
+ </div>
+ </div>
+ {{if .ShowLogout}}
+ <div class="mt-2 px-3">
+ <small class="text-muted">
+ Alternatively, <a href="/logout">log out</a>.
+ </small>
+ </div>
+ {{end}}
+ </div>
+ </div>
+</div>
+
+</body>
+</html>