mirror of
				https://github.com/HabitRPG/habitica.git
				synced 2025-10-31 05:05:07 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			11 lines
		
	
	
		
			415 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			11 lines
		
	
	
		
			415 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| const oldId = '';
 | |
| const newId = '';
 | |
| const newUser = db.users.findOne({ _id: newId });
 | |
| 
 | |
| db.users.update({ _id: oldId }, { $set: { auth: newUser.auth } });
 | |
| 
 | |
| // remove the auth on the new user (which is a template account).
 | |
| // The account will be preened automatically later,
 | |
| // this allows us to keep the account around a few days in case there was a mistake
 | |
| db.users.update({ _id: newId }, { $unset: { auth: 1 } });
 |