mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-18 21:27:51 +00:00
Remove 'signup' command
Change-type: major Signed-off-by: Paulo Castro <paulo@balena.io>
This commit is contained in:
parent
04223dbc58
commit
0bbe376e41
@ -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"
|
||||
|
||||
|
@ -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.
|
||||
|
@ -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'
|
||||
|
@ -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 ----------
|
||||
|
Loading…
Reference in New Issue
Block a user