don't need public/private paths after all, can check path requests in store accessControl callbacks
This commit is contained in:
@@ -31,8 +31,8 @@ module.exports.deleteStaleAccounts = ->
|
||||
collection.findEach un_registered, (err, user) ->
|
||||
throw err if err
|
||||
return unless user? #why does this happen sometimes?
|
||||
if !!user.priv.lastCron # for now ignore missing crons, still looking into why this is happening
|
||||
lastCron = new Date(user.priv.lastCron)
|
||||
if !!user.lastCron # for now ignore missing crons, still looking into why this is happening
|
||||
lastCron = new Date(user.lastCron)
|
||||
diff = Math.abs(moment(today).sod().diff(moment(lastCron).sod(), "days"))
|
||||
if diff > 10
|
||||
removeAccount(collection, user._id)
|
||||
|
||||
@@ -35,8 +35,8 @@ module.exports.app = (appExports, model) ->
|
||||
appExports.buyReroll = (e, el, next) ->
|
||||
batch = new schema.BatchUpdate(model)
|
||||
obj = model.get('_user')
|
||||
batch.set 'priv.balance', obj.priv.balance-1
|
||||
_.each obj.priv.tasks, (task) -> batch.set("priv.tasks.#{task.id}.value", 0) unless task.type == 'reward'
|
||||
batch.set 'balance', obj.balance-1
|
||||
_.each obj.tasks, (task) -> batch.set("tasks.#{task.id}.value", 0) unless task.type == 'reward'
|
||||
batch.commit()
|
||||
|
||||
module.exports.routes = (expressApp) ->
|
||||
@@ -53,8 +53,8 @@ module.exports.routes = (expressApp) ->
|
||||
userId = model.session.userId
|
||||
model.fetch "users.#{userId}", (err, user) ->
|
||||
model.ref '_user', "users.#{userId}"
|
||||
model.set('_user.priv.balance', model.get('_user.priv.balance')+5)
|
||||
model.set('_user.priv.flags.ads','hide')
|
||||
model.set('_user.balance', model.get('_user.balance')+5)
|
||||
model.set('_user.flags.ads','hide')
|
||||
return res.send(200)
|
||||
|
||||
api_key = process.env.STRIPE_API_KEY # secret stripe API key
|
||||
|
||||
@@ -49,8 +49,8 @@ module.exports = (expressApp, root, derby) ->
|
||||
|
||||
# Create task if doesn't exist
|
||||
# TODO add service & icon to task
|
||||
unless model.get("_user.priv.tasks.#{taskId}")
|
||||
model.refList "_habitList", "_user.priv.tasks", "_user.priv.idLists.habit"
|
||||
unless model.get("_user.tasks.#{taskId}")
|
||||
model.refList "_habitList", "_user.tasks", "_user.idLists.habit"
|
||||
model.at('_habitList').push {
|
||||
id: taskId
|
||||
type: 'habit'
|
||||
|
||||
Reference in New Issue
Block a user