Skip to content

feat(reader-registration-block): password and OTP authentication flows#4452

Draft
miguelpeixe wants to merge 3 commits intotrunkfrom
feat/reader-registration-block-auth
Draft

feat(reader-registration-block): password and OTP authentication flows#4452
miguelpeixe wants to merge 3 commits intotrunkfrom
feat/reader-registration-block-auth

Conversation

@miguelpeixe
Copy link
Member

@miguelpeixe miguelpeixe commented Feb 4, 2026

All Submissions:

Changes proposed in this Pull Request:

NPPD-1142

Repurposes the Reader Registration block to support a complete authentication flow.

How to test the changes in this Pull Request:

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the Reader Registration block to support a complete authentication flow, including password and OTP authentication for existing users. The changes extract reusable authentication utilities, add new UI states for OTP and password entry, and modify the block to handle returning users differently from new registrations.

Changes:

  • Refactored OTP input handling into reusable, exportable functions in otp-input.js
  • Created shared authentication utilities in auth-utils.js for OTP, password, and magic link handling
  • Added OTP and password authentication UI states to the Reader Registration block
  • Updated backend to detect whether existing users need password or OTP authentication

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/reader-activation-auth/otp-input.js Refactored OTP input initialization into exportable functions for reusability
src/reader-activation-auth/auth-utils.js New file containing shared authentication utilities (OTP, password, magic link handlers)
src/reader-activation-auth/auth-form.js Updated to use shared authentication utilities from auth-utils.js
src/blocks/reader-registration/view.js Implemented authentication flows with OTP and password states; fixed spelling errors
src/blocks/reader-registration/index.php Added logic to determine authentication method for existing users; removed sign-in link
src/blocks/reader-registration/style.scss Added styles for OTP and password authentication UI states
src/blocks/reader-registration/edit.js Removed sign-in link UI from block editor
src/blocks/reader-registration/block.json Removed signInLabel attribute; updated signedInLabel default

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

1 participant