Skip to content

Email Verification Link Generates "Invalid Verification Link" Error When username is in protectedFields #9264

Open
@sidan5

Description

@sidan5

Issue Description

When the username field is included in the protectedFields configuration for the _User class, the email verification link generated results in an "Invalid Verification Link" error. This seems to be caused by the username parameter being set to undefined in the verification link.

Steps to reproduce

Add username to the protectedFields for the _User class in the Parse Server configuration.
Register a new user and trigger the email verification process.
Check the email verification link sent to the user's email. The username parameter in the link will be undefined.
Attempt to verify the email using the link, resulting in an "Invalid Verification Link" error.

Actual Outcome

The username parameter is set to undefined in the verification link, causing an "Invalid Verification Link" error when attempting to verify the email.

Expected Outcome

The username should be correctly included in the email verification link, and the link should allow successful email verification.

Environment

Server

Parse Server version: 7.2.0 (also tested with 7.0.0)
Operating system: macOS 14.6
Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): Localhost

Database

System (MongoDB or Postgres): MongoDB
Database version: 7.0.12
Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): Localhost

Client

SDK (iOS, Android, JavaScript, PHP, Unity, etc): iOS
SDK version: 1.19.4

Logs

verbose: REQUEST for [GET] /parse/apps/[APP_ID]/verify_email?token=[TOKEN]&username=undefined: {}
verbose: RESPONSE from [GET] /parse/apps/[APP_ID]/verify_email?token=[TOKEN]&username=undefined: {
  "status": 302,
  "location": "http://localhost:1337/parse/apps/invalid_verification_link.html?username=undefined&appId=[APP_ID]"

Metadata

Metadata

Assignees

No one assigned

    Labels

    bounty:$20Bounty applies for fixing this issue (Parse Bounty Program)type:bugImpaired feature or lacking behavior that is likely assumed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions