From 0bbe376e414985ab8e87ebe8a48124871527245a Mon Sep 17 00:00:00 2001 From: Paulo Castro Date: Tue, 4 Jun 2019 16:31:32 +0100 Subject: [PATCH] Remove 'signup' command Change-type: major Signed-off-by: Paulo Castro --- balena-completion.bash | 4 ++-- doc/cli.markdown | 16 -------------- lib/actions/auth.coffee | 46 +++-------------------------------------- lib/app-capitano.coffee | 1 - 4 files changed, 5 insertions(+), 62 deletions(-) diff --git a/balena-completion.bash b/balena-completion.bash index 498bc65b..a1500b6c 100644 --- a/balena-completion.bash +++ b/balena-completion.bash @@ -7,7 +7,7 @@ _balena_complete() # Valid top-level completions commands="app apps build config deploy device devices env envs help key \ keys local login logout logs note os preload quickstart settings \ - signup ssh sync util version whoami" + scan ssh util version whoami" # Sub-completions app_cmds="create restart rm" config_cmds="generate inject read reconfigure write" @@ -16,7 +16,7 @@ _balena_complete() device_public_url_cmds="disable enable status" env_cmds="add rename rm" key_cmds="add rm" - local_cmds="configure flash logs push scan ssh stop" + local_cmds="configure flash" os_cmds="build-config configure download initialize versions" util_cmds="available-drives" diff --git a/doc/cli.markdown b/doc/cli.markdown index 29de8a16..6503fc02 100644 --- a/doc/cli.markdown +++ b/doc/cli.markdown @@ -85,7 +85,6 @@ If you come across any problems or would like to get in touch: - [login](#login) - [logout](#logout) - - [signup](#signup) - [whoami](#whoami) - Device @@ -330,21 +329,6 @@ Examples: $ balena logout -## signup - -Use this command to signup for a balena account. - -If signup is successful, you'll be logged in to your new user automatically. - -Examples: - - $ balena signup - Email: johndoe@acme.com - Password: *********** - - $ balena whoami - johndoe - ## whoami Use this command to find out the current logged in username and email address. diff --git a/lib/actions/auth.coffee b/lib/actions/auth.coffee index a55ccae5..52dba9be 100644 --- a/lib/actions/auth.coffee +++ b/lib/actions/auth.coffee @@ -102,8 +102,9 @@ exports.login = return patterns.askLoginType().then (loginType) -> if loginType is 'register' - { runCommand } = require('../utils/helpers') - return runCommand('signup') + signupUrl = 'https://dashboard.balena-cloud.com/signup' + require('opn')(signupUrl, { wait: false }) + patterns.exitWithExpectedError("Please sign up at #{signupUrl}") options[loginType] = true return login(options) @@ -139,47 +140,6 @@ exports.logout = balena = require('balena-sdk').fromSharedOptions() balena.auth.logout().nodeify(done) -exports.signup = - signature: 'signup' - description: 'signup to balena' - help: ''' - Use this command to signup for a balena account. - - If signup is successful, you'll be logged in to your new user automatically. - - Examples: - - $ balena signup - Email: johndoe@acme.com - Password: *********** - - $ balena whoami - johndoe - ''' - action: (params, options, done) -> - balena = require('balena-sdk').fromSharedOptions() - form = require('resin-cli-form') - validation = require('../utils/validation') - - balena.settings.get('balenaUrl').then (balenaUrl) -> - console.log("\nRegistering to #{balenaUrl}") - - form.run [ - message: 'Email:' - name: 'email' - type: 'input' - validate: validation.validateEmail - , - message: 'Password:' - name: 'password' - type: 'password', - validate: validation.validatePassword - ] - - .then(balena.auth.register) - .then(balena.auth.loginWithToken) - .nodeify(done) - exports.whoami = signature: 'whoami' description: 'get current username and email address' diff --git a/lib/app-capitano.coffee b/lib/app-capitano.coffee index 4d552948..e582a0a4 100644 --- a/lib/app-capitano.coffee +++ b/lib/app-capitano.coffee @@ -52,7 +52,6 @@ capitano.command(actions.app.info) # ---------- Auth Module ---------- capitano.command(actions.auth.login) capitano.command(actions.auth.logout) -capitano.command(actions.auth.signup) capitano.command(actions.auth.whoami) # ---------- Device Module ----------