@@ -546,10 +546,11 @@ class ParseUser extends ParseObject {
546
546
/**
547
547
* Verify whether a given password is the password of the current user.
548
548
*
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.
553
554
*/
554
555
verifyPassword(password: string, options?: RequestOptions): Promise< ParseUser > {
555
556
const username = this . getUsername ( ) || '' ;
@@ -865,13 +866,14 @@ class ParseUser extends ParseObject {
865
866
866
867
/**
867
868
* 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
872
869
* @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.
875
877
*/
876
878
static verifyPassword ( username : string , password : string , options ?: RequestOptions ) {
877
879
if ( typeof username !== 'string' ) {
@@ -1262,7 +1264,12 @@ const DefaultController = {
1262
1264
1263
1265
verifyPassword ( username : string , password : string , options : RequestOptions ) {
1264
1266
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 ) ;
1266
1273
} ,
1267
1274
1268
1275
requestEmailVerification ( email : string , options : RequestOptions ) {
0 commit comments