Skip to content

Add access-code layout and redirect page#474

Open
dmora127 wants to merge 2 commits into
path-cc:masterfrom
dmora127:preview-pearc26-aiml-patch-1
Open

Add access-code layout and redirect page#474
dmora127 wants to merge 2 commits into
path-cc:masterfrom
dmora127:preview-pearc26-aiml-patch-1

Conversation

@dmora127

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.html layout that validates an access code by hashing in the browser and redirecting on match.
  • Adds _redirects/pearc26-enroll.html which 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.

Comment thread _redirects/pearc26-enroll.html Outdated
Comment thread _layouts/access-code.html
Comment thread _layouts/access-code.html
Comment thread _layouts/access-code.html
Comment thread _layouts/access-code.html
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 thread _layouts/access-code.html
Comment on lines +27 to +28
if (hash === '{{ page.code_hash }}') {
window.location.href = '{{ page.redirect_url }}';

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 dmora127 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread _layouts/access-code.html
Comment on lines +27 to +28
if (hash === '{{ page.code_hash }}') {
window.location.href = '{{ page.redirect_url }}';

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants