Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ability to resend verification code during registration #161

Merged
merged 2 commits into from
Feb 3, 2025

Conversation

dassaswat
Copy link
Contributor

Currently, the resend verification code functionality is only available during password changes or updates. However, during the registration process, users may encounter email delivery failures. This situation forces users to restart the entire registration process to obtain a new verification code, which can be frustrating and confusing.

This PR introduces the ability to resend the verification code during the registration process. When creating custom UI, developers can add a "Resend" button that submits a form to request a new verification code. This action reloads the page and sets the appropriate authentication state, allowing the registration process to resume with the new code.

Example Implementation

Below is an example of how the resend functionality can be integrated into the registration process:

<form method="post" class="flex gap-0.5 items-center justify-center m-0">
    <input type="hidden" name="action" value="register" />
    <span>Didn't receive the code? </span>
    <Button 
        variant="link" 
        class="p-0 h-0 underline focus-visible:ring-0" 
        data-component="resend" 
        disabled
    >
        Resend
    </Button>
</form>

Maybe we can add this to the built-in themes.

For reference, you can review how the Change handler has been implemented in PasswordUI: PasswordUI Change Handler

Copy link

changeset-bot bot commented Jan 21, 2025

🦋 Changeset detected

Latest commit: 929d2ea

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@openauthjs/openauth Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@thdxr thdxr merged commit 1b5525b into openauthjs:master Feb 3, 2025
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