mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-26 17:01:04 +00:00
12 lines
272 B
CoffeeScript
12 lines
272 B
CoffeeScript
auth = require('../auth/auth')
|
|
messages = require('../messages/messages')
|
|
|
|
exports.failIfNotLoggedIn = (fn) ->
|
|
return ->
|
|
args = arguments
|
|
auth.isLoggedIn (isLoggedIn) ->
|
|
if not isLoggedIn
|
|
throw new Error(messages.errors.loginRequired)
|
|
|
|
fn.apply(null, args)
|