mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
[misc] keep up with web changes -- add waitForDb wrapper for tasks
This commit is contained in:
parent
1110d0f867
commit
fe3edd7197
1 changed files with 37 additions and 33 deletions
|
@ -9,8 +9,10 @@ module.exports = (grunt) ->
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
|
|
||||||
settings = require "settings-sharelatex"
|
settings = require "settings-sharelatex"
|
||||||
|
mongodb = require "../web/app/src/infrastructure/mongodb"
|
||||||
UserRegistrationHandler = require "../web/app/src/Features/User/UserRegistrationHandler"
|
UserRegistrationHandler = require "../web/app/src/Features/User/UserRegistrationHandler"
|
||||||
OneTimeTokenHandler = require "../web/app/src/Features/Security/OneTimeTokenHandler"
|
OneTimeTokenHandler = require "../web/app/src/Features/Security/OneTimeTokenHandler"
|
||||||
|
mongodb.waitForDb().then () ->
|
||||||
UserRegistrationHandler.registerNewUser {
|
UserRegistrationHandler.registerNewUser {
|
||||||
email: email
|
email: email
|
||||||
password: require("crypto").randomBytes(32).toString("hex")
|
password: require("crypto").randomBytes(32).toString("hex")
|
||||||
|
@ -42,8 +44,10 @@ module.exports = (grunt) ->
|
||||||
console.error "Usage: grunt user:delete --email=joe@example.com"
|
console.error "Usage: grunt user:delete --email=joe@example.com"
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
settings = require "settings-sharelatex"
|
settings = require "settings-sharelatex"
|
||||||
|
mongodb = require "../web/app/src/infrastructure/mongodb"
|
||||||
UserGetter = require "../web/app/src/Features/User/UserGetter"
|
UserGetter = require "../web/app/src/Features/User/UserGetter"
|
||||||
UserDeleter = require "../web/app/src/Features/User/UserDeleter"
|
UserDeleter = require "../web/app/src/Features/User/UserDeleter"
|
||||||
|
mongodb.waitForDb().then () ->
|
||||||
UserGetter.getUser email:email, (error, user) ->
|
UserGetter.getUser email:email, (error, user) ->
|
||||||
if error?
|
if error?
|
||||||
throw error
|
throw error
|
||||||
|
|
Loading…
Reference in a new issue