mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-01-31 16:36:24 +00:00
11 lines
258 B
CoffeeScript
11 lines
258 B
CoffeeScript
auth = require('../auth/auth')
|
|
messages = require('../messages/messages')
|
|
|
|
exports.failIfNotLoggedIn = (fn) ->
|
|
return ->
|
|
auth.isLoggedIn (isLoggedIn) ->
|
|
if not isLoggedIn
|
|
throw new Error(messages.errors.loginRequired)
|
|
|
|
fn.apply(null, arguments)
|