mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
tests: updated passoword test setup
This commit is contained in:
@@ -118,17 +118,25 @@ Accounts.config({
|
||||
});
|
||||
|
||||
|
||||
Meteor.methods({
|
||||
testMeteorUser: () => Meteor.user(),
|
||||
clearUsernameAndProfile: function () {
|
||||
if (!this.userId)
|
||||
throw new Error("Not logged in!");
|
||||
Meteor.users.update(this.userId,
|
||||
{$unset: {profile: 1, username: 1}});
|
||||
},
|
||||
Meteor.methods(
|
||||
{
|
||||
testMeteorUser:
|
||||
async () => await Meteor.user(),
|
||||
|
||||
expireTokens: function () {
|
||||
Accounts._expireTokens(new Date(), this.userId);
|
||||
},
|
||||
removeUser: username => Meteor.users.remove({ "username": username }),
|
||||
});
|
||||
clearUsernameAndProfile:
|
||||
async function () {
|
||||
if (!this.userId) throw new Error("Not logged in!");
|
||||
await Meteor
|
||||
.users
|
||||
.update(this.userId, { $unset: { profile: 1, username: 1 } });
|
||||
},
|
||||
|
||||
expireTokens:
|
||||
async function () {
|
||||
await Accounts._expireTokens(new Date(), this.userId);
|
||||
},
|
||||
|
||||
removeUser:
|
||||
async username => await Meteor.users.remove({ "username": username }),
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user