Browse Source

Force to use a user account

Godzil 5 years ago
parent
commit
523c780b18
1 changed files with 9 additions and 3 deletions
  1. 9 3
      src/my_request.ts

+ 9 - 3
src/my_request.ts

@@ -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);
     });