Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions _layouts/access-code.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<title>{{ page.title | default: "Access Code Required" }}</title>
<div style="display:flex; height:100vh;">
<div style="margin:auto; text-align:center; max-width:400px; padding:0 20px;">
<div>
<img style="width: 100%;" alt="PATh Logo" src="{{ '/images/logo/Logo_Round_Med.png' | relative_url }}">
</div>
<div style="margin-top: 20px;">
<p>{{ page.prompt_text | default: "Enter the access code to continue" }}</p>
<form id="access-form">
<input id="access-code" type="password" autocomplete="off" autofocus
style="padding: 8px; font-size: 1rem; width: 60%;">
Comment on lines +10 to +11
<button type="submit" style="padding: 8px 16px; font-size: 1rem; cursor: pointer;">Submit</button>
</form>
<p id="access-error" style="color: #b00020; margin-top: 12px; visibility: hidden;">
Incorrect access code. Please try again.
</p>
Comment on lines +14 to +16
</div>
</div>
</div>
<script>
document.getElementById('access-form').addEventListener('submit', async function (e) {
e.preventDefault();
const code = document.getElementById('access-code').value.trim();
const digest = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(code));
const hash = Array.from(new Uint8Array(digest))
.map(b => b.toString(16).padStart(2, '0')).join('');
if (hash === '{{ page.code_hash }}') {
window.location.href = '{{ page.redirect_url }}';
Comment on lines +27 to +28
} else {
document.getElementById('access-error').style.visibility = 'visible';
}
});
Comment on lines +21 to +32
</script>
10 changes: 10 additions & 0 deletions _redirects/pearc26-enroll.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
layout: access-code
permalink: /pearc26-enroll.html
redirect_url: hhttps://registry.cilogon.org/registry/co_petitions/start/coef:652
prompt_text: Enter the access code to continue
# SHA-256 of the access code. To change the code, run:
# printf %s 'new-code-here' | shasum -a 256
# and paste the resulting hex digest below.
code_hash: d648faf4947e5c7252796f532d7109c14226a8255b82c93ec553f773b6e66236
---
Loading