parse-server icon indicating copy to clipboard operation
parse-server copied to clipboard

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

Open sidan5 opened this issue 1 year ago • 1 comments
trafficstars

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]"

sidan5 avatar Jul 30 '24 15:07 sidan5

Thanks for opening this issue!