jitsu crashes trying to list apps when not logged in #299

Closed
ghost opened this Issue Aug 26, 2012 · 3 comments

Projects

None yet

2 participants

@ghost

Hi guys,

I just signed up to nodejitsu.com and noticed an issue with the jitsu tool. I logged out and then tried to list the apps. Here comes the output:

$user@$host: jitsu list
info: Welcome to Nodejitsu
info: jitsu v0.9.7
info: It worked if it ends with Nodejitsu ok
info: Executing command list
info: Welcome to Nodejitsu
info: jitsu v0.9.7
info: It worked if it ends with Nodejitsu ok
info: Executing command list>

/home/$user/lib/node_modules/jitsu/lib/jitsu/commands/apps.js:283
jitsu.log.info('Listing all apps for ' + username.magenta);
^
TypeError: Cannot read property 'magenta' of undefined
at apps.list (/home/$user/lib/node_modules/jitsu/lib/jitsu/commands/apps.js:283:52)
at executeCommand (/home/$user/lib/node_modules/jitsu/node_modules/flatiron/lib/flatiron/plugins/cli.js:298:19)
at Object.exports.commands.app.router.notfound (/home/$user/lib/node_modules/jitsu/node_modules/flatiron/lib/flatiron/plugins/cli.js:358:5)
at Router.dispatch (/home/$user/lib/node_modules/jitsu/node_modules/flatiron/node_modules/director/lib/director/cli.js:50:21)
at execCommand (/home/$user/lib/node_modules/jitsu/lib/jitsu.js:210:18)
at jitsu.exec (/home/$user/lib/node_modules/jitsu/lib/jitsu.js:223:54)
at jitsu.start (/home/$user/lib/node_modules/jitsu/lib/jitsu.js:174:20)
at App.init (/home/$user/lib/node_modules/jitsu/node_modules/flatiron/node_modules/broadway/lib/broadway/app.js:74:12)
at App.init (/home/$user/lib/node_modules/jitsu/node_modules/flatiron/lib/flatiron/app.js:31:31)
at jitsu.start (/home/$user/lib/node_modules/jitsu/lib/jitsu.js:141:11)

Nearly forgotten:

$user@$host: node -v
v.0.8.1

$user@$host: npm -v
1.1.33

$user@$host: jitsu -v
0.9.7

@jfhbrook

Nice find!

I think the proper action here is to check if the username is defined, and then show a message like, "You need to log in to do that!"

@ghost

Same is for jitsu view.

@Marak

This is a regression.

All commands that are not signup or login should require user is logged in.

Currently, it looks like there is no common handler for un-auth commands at all.

@ghost Unknown referenced this issue Sep 3, 2012
Merged

Fixed crash with jitsu list #307

@ghost ghost closed this Sep 3, 2012
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment