Make use of authHooks in actions

This commit is contained in:
Juan Cruz Viotti 2014-11-18 12:37:01 -04:00
parent 8bdd3b697a
commit 8777bb9536
2 changed files with 4 additions and 2 deletions

View File

@ -1,7 +1,8 @@
server = require('../server/server')
applicationModel = require('../models/application')
authHooks = require('../hooks/auth')
exports.list = ->
exports.list = authHooks.failIfNotLoggedIn ->
applicationModel.getAll().then (applications) ->
for app in applications

View File

@ -1,6 +1,7 @@
open = require('open')
async = require('async')
auth = require('../auth/auth')
authHooks = require('../hooks/auth')
widgets = require('../widgets/widgets')
config = require('../config')
@ -19,7 +20,7 @@ exports.login = (credentials) ->
], (error) ->
throw error if error?
exports.logout = ->
exports.logout = authHooks.failIfNotLoggedIn ->
auth.logout()
exports.signup = ->