From 10ab95b0dd5a68fc62b2c6fbb21bf822f2db41a2 Mon Sep 17 00:00:00 2001 From: Florent Vilmart Date: Mon, 15 May 2017 22:46:44 -0400 Subject: [PATCH] Adds repro to issue #3289 --- spec/ParseUser.spec.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/spec/ParseUser.spec.js b/spec/ParseUser.spec.js index d6762161b9..7e144bc5aa 100644 --- a/spec/ParseUser.spec.js +++ b/spec/ParseUser.spec.js @@ -2935,4 +2935,21 @@ describe('Parse.User testing', () => { done(); }); }); + + it('should revoke sessions when setting paswword with masterKey (#3289)', (done) => { + let user; + Parse.User.signUp('username', 'password') + .then((newUser) => { + user = newUser; + user.set('password', 'newPassword'); + return user.save(null, {useMasterKey: true}); + }).then(() => { + const query = new Parse.Query('_Session'); + query.equalTo('user', user); + return query.find({useMasterKey: true}); + }).then((results) => { + expect(results.length).toBe(0); + done(); + }, done.fail); + }); });