feat(reader-registration-block): password and OTP authentication flows#4452
Draft
miguelpeixe wants to merge 3 commits intotrunkfrom
Draft
feat(reader-registration-block): password and OTP authentication flows#4452miguelpeixe wants to merge 3 commits intotrunkfrom
miguelpeixe wants to merge 3 commits intotrunkfrom
Conversation
Contributor
There was a problem hiding this comment.
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.jsfor 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.
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.
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: