mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-01-18 02:39:49 +00:00
Make use of authHooks in actions
This commit is contained in:
parent
8bdd3b697a
commit
8777bb9536
@ -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
|
||||
|
@ -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 = ->
|
||||
|
Loading…
Reference in New Issue
Block a user