Remove 'signup' command

Change-type: major
Signed-off-by: Paulo Castro <paulo@balena.io>
This commit is contained in:
Paulo Castro 2019-06-04 16:31:32 +01:00
parent 04223dbc58
commit 0bbe376e41
4 changed files with 5 additions and 62 deletions

View File

@ -7,7 +7,7 @@ _balena_complete()
# Valid top-level completions # Valid top-level completions
commands="app apps build config deploy device devices env envs help key \ commands="app apps build config deploy device devices env envs help key \
keys local login logout logs note os preload quickstart settings \ keys local login logout logs note os preload quickstart settings \
signup ssh sync util version whoami" scan ssh util version whoami"
# Sub-completions # Sub-completions
app_cmds="create restart rm" app_cmds="create restart rm"
config_cmds="generate inject read reconfigure write" config_cmds="generate inject read reconfigure write"
@ -16,7 +16,7 @@ _balena_complete()
device_public_url_cmds="disable enable status" device_public_url_cmds="disable enable status"
env_cmds="add rename rm" env_cmds="add rename rm"
key_cmds="add 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" os_cmds="build-config configure download initialize versions"
util_cmds="available-drives" util_cmds="available-drives"

View File

@ -85,7 +85,6 @@ If you come across any problems or would like to get in touch:
- [login](#login) - [login](#login)
- [logout](#logout) - [logout](#logout)
- [signup](#signup)
- [whoami](#whoami) - [whoami](#whoami)
- Device - Device
@ -330,21 +329,6 @@ Examples:
$ balena logout $ 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 ## whoami
Use this command to find out the current logged in username and email address. Use this command to find out the current logged in username and email address.

View File

@ -102,8 +102,9 @@ exports.login =
return patterns.askLoginType().then (loginType) -> return patterns.askLoginType().then (loginType) ->
if loginType is 'register' if loginType is 'register'
{ runCommand } = require('../utils/helpers') signupUrl = 'https://dashboard.balena-cloud.com/signup'
return runCommand('signup') require('opn')(signupUrl, { wait: false })
patterns.exitWithExpectedError("Please sign up at #{signupUrl}")
options[loginType] = true options[loginType] = true
return login(options) return login(options)
@ -139,47 +140,6 @@ exports.logout =
balena = require('balena-sdk').fromSharedOptions() balena = require('balena-sdk').fromSharedOptions()
balena.auth.logout().nodeify(done) 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 = exports.whoami =
signature: 'whoami' signature: 'whoami'
description: 'get current username and email address' description: 'get current username and email address'

View File

@ -52,7 +52,6 @@ capitano.command(actions.app.info)
# ---------- Auth Module ---------- # ---------- Auth Module ----------
capitano.command(actions.auth.login) capitano.command(actions.auth.login)
capitano.command(actions.auth.logout) capitano.command(actions.auth.logout)
capitano.command(actions.auth.signup)
capitano.command(actions.auth.whoami) capitano.command(actions.auth.whoami)
# ---------- Device Module ---------- # ---------- Device Module ----------