mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-01-30 08:03:55 +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')
|
server = require('../server/server')
|
||||||
applicationModel = require('../models/application')
|
applicationModel = require('../models/application')
|
||||||
|
authHooks = require('../hooks/auth')
|
||||||
|
|
||||||
exports.list = ->
|
exports.list = authHooks.failIfNotLoggedIn ->
|
||||||
|
|
||||||
applicationModel.getAll().then (applications) ->
|
applicationModel.getAll().then (applications) ->
|
||||||
for app in applications
|
for app in applications
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
open = require('open')
|
open = require('open')
|
||||||
async = require('async')
|
async = require('async')
|
||||||
auth = require('../auth/auth')
|
auth = require('../auth/auth')
|
||||||
|
authHooks = require('../hooks/auth')
|
||||||
widgets = require('../widgets/widgets')
|
widgets = require('../widgets/widgets')
|
||||||
config = require('../config')
|
config = require('../config')
|
||||||
|
|
||||||
@ -19,7 +20,7 @@ exports.login = (credentials) ->
|
|||||||
], (error) ->
|
], (error) ->
|
||||||
throw error if error?
|
throw error if error?
|
||||||
|
|
||||||
exports.logout = ->
|
exports.logout = authHooks.failIfNotLoggedIn ->
|
||||||
auth.logout()
|
auth.logout()
|
||||||
|
|
||||||
exports.signup = ->
|
exports.signup = ->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user