mirror of
https://github.com/pocket-id/pocket-id.git
synced 2025-12-06 09:13:19 +03:00
🚀 Feature: Implement Email Verification for non-LDAP User Accounts #93
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @zeedif on GitHub.
Feature description
This feature proposes the implementation of a full email verification process for user accounts in Pocket ID. This would enhance security and provide a more robust identity verification mechanism.
The implementation would include:
email_verified(boolean), should be added to the user model in the database, defaulting tofalse.email_verifiedstatus totrue, and provide feedback to the user that their email has been successfully verified./settings/account), there should be a clear visual indicator (e.g., an alert banner) if their email is not yet verified. This indicator should include a button allowing the user to resend the verification email.Pitch
Implementing email verification is a standard and crucial security feature for any identity provider. It ensures that the user who signs up for an account actually controls the email address they provided. This builds a foundational layer of trust and is essential for features like account recovery.
Currently, Pocket ID has a global setting called "Emails Verified". Its current behavior is a simple override. This proposal suggests introducing a new master toggle for email verification and repurposing the existing "Emails Verified" setting to provide both enhanced security and backward compatibility.
Proposed New Behavior:
A new toggle, "Enable Email Verification", will be added under the "Enabled Emails" section.
Scenario 1: "Enable Email Verification" is OFF (Default/Current Behavior)
email_verifiedclaim in OIDC ID tokens:email_verified: true.email_verified: false.Scenario 2: "Enable Email Verification" is ON (New Verification Flow)
email_verifiedclaim in the OIDC ID token will accurately reflect the user's actual verification status from the database. It will betrueonly if the user has clicked the verification link. This is the most secure and correct implementation.email_verifiedclaim will always betruefor all users, regardless of their actual verification status in the database. This maintains backward compatibility for existing applications that might rely on this claim always being true, allowing administrators to adopt the new verification feature without disrupting services.Benefits of this feature:
email_verifiedclaim meaningful and accurate, which is expected by many OIDC clients.Since Pocket ID already has a robust SMTP configuration and email sending capabilities, the foundational work for sending these verification emails is already in place. This feature would leverage that existing infrastructure to add a critical layer of identity verification.