mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-04-14 19:56:23 +00:00
add migration script for moving facebook auth'd users to local
auth (seems people hate facebook)
This commit is contained in:
parent
dfff22c52b
commit
6ab64e2df1
2 changed files with 11 additions and 1 deletions
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* Set this up as a midnight cron script
|
||||
*
|
||||
* mongo habitrpg node_modules/moment/moment.js migrations/json.js migrations/20130212_preen_cron.js
|
||||
* mongo habitrpg node_modules/moment/moment.js migrations/20130212_preen_cron.js
|
||||
*/
|
||||
|
||||
|
||||
|
|
|
|||
10
migrations/facebook_to_local.js
Normal file
10
migrations/facebook_to_local.js
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
var oldId = "",
|
||||
newId = "",
|
||||
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}});
|
||||
|
||||
Loading…
Reference in a new issue