Add access-code layout and redirect page#474
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a simple “access code required” landing page (via a new Jekyll layout) and a PEARC26 enrollment redirect page that uses that layout to gate navigation to an external registration URL.
Changes:
- Introduces a new
_layouts/access-code.htmllayout that validates an access code by hashing in the browser and redirecting on match. - Adds
_redirects/pearc26-enroll.htmlwhich configures the access-code layout with a redirect target, prompt text, and expected hash.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
_redirects/pearc26-enroll.html |
New redirect page configuring the access-code prompt, redirect URL, and stored hash. |
_layouts/access-code.html |
New layout providing the access-code form UI and client-side SHA-256 verification + redirect logic. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| 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 }}'; | ||
| } else { | ||
| document.getElementById('access-error').style.visibility = 'visible'; | ||
| } | ||
| }); |
| if (hash === '{{ page.code_hash }}') { | ||
| window.location.href = '{{ page.redirect_url }}'; |
There was a problem hiding this comment.
It's mainly a deterrent for widely sharing it. The redirect still sends folk to an enrollment flow and adds a provisional account COU. Not a major concern for me.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
dmora127
left a comment
There was a problem hiding this comment.
Closed a few comments/suggestions it made that add complexity for a temporary page (will be taken down tuesday morning). Leaving the commend on R21-R32 below up to you @brianhlin.
| if (hash === '{{ page.code_hash }}') { | ||
| window.location.href = '{{ page.redirect_url }}'; |
There was a problem hiding this comment.
It's mainly a deterrent for widely sharing it. The redirect still sends folk to an enrollment flow and adds a provisional account COU. Not a major concern for me.
No description provided.