Force to use a user account

This commit is contained in:
Godzil
2018-07-14 20:41:14 +01:00
parent 6c2100fbff
commit 523c780b18

View File

@@ -127,9 +127,15 @@ export function post(config: IConfig, options: request.Options, done: (err: Erro
*/
function authenticate(config: IConfig, done: (err: Error) => void)
{
if (isAuthenticated || !config.pass || !config.user)
if (isAuthenticated)
{
return done(null);
return done(null);
}
if (!config.pass || !config.user)
{
log.error('You need to give login/password to use Crunchy');
process.exit(-1);
}
startSession()
@@ -190,7 +196,7 @@ function authenticate(config: IConfig, done: (err: Error) => void)
}
else
{
log.info('You have a premium account! Good!');
log.info('You have a premium account! Good!');
}
done(null);
});