Add access-code layout and redirect page#474
Open
dmora127 wants to merge 1 commit into
Open
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.
| --- | ||
| layout: access-code | ||
| permalink: /pearc26-enroll.html | ||
| redirect_url: hhttps://registry.cilogon.org/registry/co_petitions/start/coef:652 |
| @@ -0,0 +1,33 @@ | |||
| <title>{{ page.title | default: "Access Code Required" }}</title> | |||
Comment on lines
+10
to
+11
| <input id="access-code" type="password" autocomplete="off" autofocus | ||
| style="padding: 8px; font-size: 1rem; width: 60%;"> |
Comment on lines
+14
to
+16
| <p id="access-error" style="color: #b00020; margin-top: 12px; visibility: hidden;"> | ||
| Incorrect access code. Please try again. | ||
| </p> |
Comment on lines
+21
to
+32
| 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'; | ||
| } | ||
| }); |
Comment on lines
+27
to
+28
| if (hash === '{{ page.code_hash }}') { | ||
| window.location.href = '{{ page.redirect_url }}'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.