mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge branch 'master' of github.com:sharelatex/web-sharelatex
This commit is contained in:
commit
42f2b262c2
1 changed files with 21 additions and 1 deletions
|
@ -357,3 +357,23 @@ module.exports = (grunt) ->
|
|||
|
||||
"""
|
||||
done()
|
||||
|
||||
grunt.registerTask 'delete-user', "deletes a user and all their data", () ->
|
||||
done = @async()
|
||||
email = grunt.option("email")
|
||||
if !email?
|
||||
console.error "Usage: grunt delete-user --email joe@example.com"
|
||||
process.exit(1)
|
||||
settings = require "settings-sharelatex"
|
||||
UserGetter = require "./app/js/Features/User/UserGetter"
|
||||
UserDeleter = require "./app/js/Features/User/UserDeleter"
|
||||
UserGetter.getUser email:email, (error, user) ->
|
||||
if error?
|
||||
throw error
|
||||
if !user?
|
||||
console.log("user #{email} not in database, potentially already deleted")
|
||||
return done()
|
||||
UserDeleter.deleteUser user._id, (err)->
|
||||
if err?
|
||||
throw err
|
||||
done()
|
Loading…
Reference in a new issue