@@ -546,10 +546,11 @@ class ParseUser extends ParseObject {
546546 /**
547547 * Verify whether a given password is the password of the current user.
548548 *
549- * @param { string } password A password to be verified
550- * @param { object } options
551- * @returns { Promise } A promise that is fulfilled with a user
552- * when the password is correct.
549+ * @param { string } password The password to be verified.
550+ * @param { object } options The options.
551+ * @param { boolean } [options.ignoreEmailVerification=false] Set to `true` to bypass email verification and verify
552+ * the password regardless of whether the email has been verified. This requires the master key.
553+ * @returns { Promise } A promise that is fulfilled with a user when the password is correct.
553554 */
554555 verifyPassword(password: string, options?: RequestOptions): Promise< ParseUser > {
555556 const username = this . getUsername ( ) || '' ;
@@ -865,13 +866,14 @@ class ParseUser extends ParseObject {
865866
866867 /**
867868 * Verify whether a given password is the password of the current user.
868- *
869- * @param {string } username A username to be used for identificaiton
870- * @param {string } password A password to be verified
871- * @param {object } options
872869 * @static
873- * @returns {Promise } A promise that is fulfilled with a user
874- * when the password is correct.
870+ *
871+ * @param {string } username The username of the user whose password should be verified.
872+ * @param {string } password The password to be verified.
873+ * @param {object } options The options.
874+ * @param {boolean } [options.ignoreEmailVerification=false] Set to `true` to bypass email verification and verify
875+ * the password regardless of whether the email has been verified. This requires the master key.
876+ * @returns {Promise } A promise that is fulfilled with a user when the password is correct.
875877 */
876878 static verifyPassword ( username : string , password : string , options ?: RequestOptions ) {
877879 if ( typeof username !== 'string' ) {
@@ -1262,7 +1264,12 @@ const DefaultController = {
12621264
12631265 verifyPassword ( username : string , password : string , options : RequestOptions ) {
12641266 const RESTController = CoreManager . getRESTController ( ) ;
1265- return RESTController . request ( 'GET' , 'verifyPassword' , { username, password } , options ) ;
1267+ const data = {
1268+ username ,
1269+ password ,
1270+ ...( options . ignoreEmailVerification !== undefined && { ignoreEmailVerification : options . ignoreEmailVerification } ) ,
1271+ } ;
1272+ return RESTController . request ( 'GET' , 'verifyPassword' , data , options ) ;
12661273 } ,
12671274
12681275 requestEmailVerification ( email : string , options : RequestOptions ) {
0 commit comments