mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-01-31 08:25:36 +00:00
HOTFIX: isLoggedIn now returns a possible error
This commit is contained in:
parent
73736abdea
commit
7e5ecd634d
@ -18,7 +18,10 @@
|
||||
update = require('./update');
|
||||
|
||||
capitano.permission('user', function(done) {
|
||||
return resin.auth.isLoggedIn(function(isLoggedIn) {
|
||||
return resin.auth.isLoggedIn(function(error, isLoggedIn) {
|
||||
if (error != null) {
|
||||
return done(error);
|
||||
}
|
||||
if (!isLoggedIn) {
|
||||
return done(new Error('You have to log in'));
|
||||
}
|
||||
|
@ -8,7 +8,8 @@ plugins = require('./plugins')
|
||||
update = require('./update')
|
||||
|
||||
capitano.permission 'user', (done) ->
|
||||
resin.auth.isLoggedIn (isLoggedIn) ->
|
||||
resin.auth.isLoggedIn (error, isLoggedIn) ->
|
||||
return done(error) if error?
|
||||
if not isLoggedIn
|
||||
return done(new Error('You have to log in'))
|
||||
return done()
|
||||
|
Loading…
x
Reference in New Issue
Block a user